NoQ added a comment.

Nice catch, thanks!

Comment at: lib/StaticAnalyzer/Core/ExprEngineC.cpp:1078-1080
+    // The use of an operand of type bool with the ++ operators is deprecated
+    // but valid untill C++17. And if the operand of the increment operator is
+    // of type bool, it is set to true untill C++17.
`untill` seems to be deprecated in favor of `until`.

Comment at: lib/StaticAnalyzer/Core/ExprEngineC.cpp:1082
+    if (U->getType()->isBooleanType() && U->isIncrementOp() &&
+        AMgr.getLangOpts().CPlusPlus)
+      Result = svalBuilder.makeTruthVal(true, U->getType());
Doesn't `isBooleanType()` imply `CPlusPlus`? I guess we need to see if it works 
in Objective-C++ as well.

Comment at: test/Analysis/bool.cpp:65
+    bool b = -10;
+    clang_analyzer_dump(b); // expected-warning{{1 U1b}}
+  }
`dump()` exposes too much internals, we try to only use it for debugging, not 
for tests.

Would eg. `clang_analyzer_eval(b == 1)` be enough?

  rC Clang

cfe-commits mailing list

Reply via email to