[PATCH] D28837: [libcxx] [test] Fix MSVC warnings C4127 and C6326 about constants.
Stephan T. Lavavej via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 17 17:53:01 PST 2017
STL_MSFT created this revision.
[libcxx] [test] Fix MSVC warnings C4127 and C6326 about constants.
MSVC has compiler warnings C4127 "conditional expression is constant" (enabled
by /https://reviews.llvm.org/W4) and C6326 "Potential comparison of a constant with another constant"
(enabled by /analyze). They're potentially useful, although they're slightly
annoying to library devs who know what they're doing. In the latest version of
the compiler, C4127 is suppressed when the compiler sees simple tests like
"if (name_of_thing)", so extracting comparison expressions into named
constants is a workaround. At the same time, using std::integral_constant
avoids C6326, which doesn't look at template arguments.
Replace 1 == 1 with true, which is the same as far as the library is concerned.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 11684 bytes
Desc: not available
More information about the cfe-commits