Last Comment Bug 713560 - MOZ_STATIC_ASSERT doesn't use 'reason' as often as it could
: MOZ_STATIC_ASSERT doesn't use 'reason' as often as it could
Product: Core
Classification: Components
Component: MFBT (show other bugs)
: Trunk
: All All
-- normal (vote)
: mozilla12
Assigned To: Jeff Walden [:Waldo] (remove +bmo to email)
Depends on:
  Show dependency treegraph
Reported: 2011-12-26 13:16 PST by Zack Weinberg (:zwol)
Modified: 2011-12-28 11:07 PST (History)
2 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description User image Zack Weinberg (:zwol) 2011-12-26 13:16:57 PST
MOZ_STATIC_ASSERT(cond, reason) is #defined to the C++11 static_assert() whenever available; due to the variety of compilers we support, there are four separate #defines that do that, under a bunch of #ifdefs, in the present version of the file: <>

Only one of those four definitions reads

#      define MOZ_STATIC_ASSERT(cond, reason)    static_assert((cond), reason)

the other three are

#      define MOZ_STATIC_ASSERT(cond, reason)    static_assert((cond), #cond)

making no use of 'reason'. This seems wrong.
Comment 1 User image Jeff Walden [:Waldo] (remove +bmo to email) 2011-12-27 10:17:47 PST
Hmm, yeah, that was wrong, wasn't it.  Thanks for pointing it out, fixed here (seems typo-land enough that it's not worth wasting someone's time reviewing it):
Comment 2 User image Matt Brubeck (:mbrubeck) 2011-12-28 11:07:26 PST

Note You need to log in before you can comment on or make changes to this bug.