-
thakis authored
[cpp.cond]p4: Prior to evaluation, macro invocations in the list of preprocessing tokens that will become the controlling constant expression are replaced (except for those macro names modified by the 'defined' unary operator), just as in normal text. If the token 'defined' is generated as a result of this replacement process or use of the 'defined' unary operator does not match one of the two specified forms prior to macro replacement, the behavior is undefined. This isn't an idle threat, consider this program: #define FOO #define BAR defined(FOO) #if BAR ... #else ... #endif clang and gcc will pick the #if branch while Visual Studio will take the #else branch. This works fine in this file since it's not built on Windows, but relying on that seems a bit risky. (I'm prototyping a compiler warning for this -- not sure yet a compiler warning is worth it, but fixing this file is.) No behavior change. BUG=428589 Review URL: https://codereview.chromium.org/1584203002 Cr-Commit-Position: refs/heads/master@{#369872}
36e38a24