Note: There are a few cases of duplicates in user autocompletion which are being worked on.

MOZ_STATIC_ASSERT doesn't use 'reason' as often as it could

RESOLVED FIXED in mozilla12

Status

()

Core
MFBT
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: zwol, Assigned: Waldo)

Tracking

Trunk
mozilla12
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

6 years ago
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: <http://hg.mozilla.org/mozilla-central/file/9f29daaecbcc/mfbt/Assertions.h#l63>

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.
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):

https://hg.mozilla.org/integration/mozilla-inbound/rev/3b3f1c6d6983
Assignee: nobody → jwalden+bmo
Status: NEW → ASSIGNED
OS: Mac OS X → All
Hardware: x86 → All
Target Milestone: --- → mozilla12
https://hg.mozilla.org/mozilla-central/rev/3b3f1c6d6983
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.