NoQ added inline comments.
================ Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1753-1755 + // It so happens that CFGBlock::getTerminatorCondition returns 'A' for block + // B1, 'A && B' for B2, and 'A && B || C' for B3. Let's check whether we + // reached the end of the condition! ---------------- Szelethus wrote: > NoQ wrote: > > Clever trick, but why not match for logical operators directly? Something > > like this: > > ```lang=c++ > > if (auto B = dyn_cast<BinaryOperator>(OuterCond)) > > if (B->isLogicalOp()) > > return isAssertlikeBlock(Else, Context); > > ``` > What about `assert(a + b && "Shouldn't be zero!");`? Mmm, could you elaborate? >.< ================ Comment at: clang/test/Analysis/track-control-dependency-conditions.cpp:469-471 +extern void __assert_fail (__const char *__assertion, __const char *__file, + unsigned int __line, __const char *__function) +__attribute__ ((__noreturn__)); ---------------- Szelethus wrote: > NoQ wrote: > > I'm pretty sure you can define this function only once. > Note that it is in a namespace! I mean, why is it in a namespace? Why not just define it once for the whole file? It's not like you're gonna be trying out different variants of `__assert_fail`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65287/new/ https://reviews.llvm.org/D65287 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits