Index: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h =================================================================== --- clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h +++ clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h @@ -188,22 +188,23 @@ BugReporterContext &BRC); std::shared_ptr - VisitTrueTest(const Expr *Cond, bool tookTrue, BugReporterContext &BRC, - BugReport &R, const ExplodedNode *N); + VisitTrueTest(const Expr *Cond, BugReporterContext &BRC, BugReport &R, + const ExplodedNode *N, bool TookTrue); std::shared_ptr - VisitTrueTest(const Expr *Cond, const DeclRefExpr *DR, const bool tookTrue, - BugReporterContext &BRC, BugReport &R, const ExplodedNode *N); + VisitTrueTest(const Expr *Cond, const DeclRefExpr *DR, + BugReporterContext &BRC, BugReport &R, const ExplodedNode *N, + bool TookTrue, bool IsAssuming); std::shared_ptr VisitTrueTest(const Expr *Cond, const BinaryOperator *BExpr, - const bool tookTrue, BugReporterContext &BRC, BugReport &R, - const ExplodedNode *N); + BugReporterContext &BRC, BugReport &R, const ExplodedNode *N, + bool TookTrue, bool IsAssuming); std::shared_ptr VisitConditionVariable(StringRef LhsString, const Expr *CondVarExpr, - const bool tookTrue, BugReporterContext &BRC, - BugReport &R, const ExplodedNode *N); + BugReporterContext &BRC, BugReport &R, + const ExplodedNode *N, bool TookTrue); bool patternMatch(const Expr *Ex, const Expr *ParentEx, Index: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp =================================================================== --- clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp +++ clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp @@ -179,6 +179,23 @@ RLCV->getStore() == RightNode->getState()->getStore(); } +static Optional +getConcreteIntegerValue(const Expr *CondVarExpr, const ExplodedNode *N) { + ProgramStateRef State = N->getState(); + const LocationContext *LCtx = N->getLocationContext(); + + // The declaration of the value may rely on a pointer so take its l-value. + if (const auto *DRE = dyn_cast_or_null(CondVarExpr)) { + if (const auto *VD = dyn_cast_or_null(DRE->getDecl())) { + SVal DeclSVal = State->getSVal(State->getLValue(VD, LCtx)); + if (auto DeclCI = DeclSVal.getAs()) + return &DeclCI->getValue(); + } + } + + return {}; +} + //===----------------------------------------------------------------------===// // Definitions for bug reporter visitors. //===----------------------------------------------------------------------===// @@ -1841,30 +1858,37 @@ std::shared_ptr ConditionBRVisitor::VisitNodeImpl(const ExplodedNode *N, BugReporterContext &BRC, BugReport &BR) { - ProgramPoint progPoint = N->getLocation(); + ProgramPoint ProgPoint = N->getLocation(); + const std::pair &Tags = + ExprEngine::geteagerlyAssumeBinOpBifurcationTags(); // If an assumption was made on a branch, it should be caught // here by looking at the state transition. - if (Optional BE = progPoint.getAs()) { - const CFGBlock *srcBlk = BE->getSrc(); - if (const Stmt *term = srcBlk->getTerminator()) - return VisitTerminator(term, N, srcBlk, BE->getDst(), BR, BRC); + if (Optional BE = ProgPoint.getAs()) { + const CFGBlock *SrcBlock = BE->getSrc(); + if (const Stmt *Term = SrcBlock->getTerminator()) { + + // If the tag of the previous node is 'Eagerly Assume...' the current + // 'BlockEdge' has the same constraint information. We do not want to + // report the value as it is just an assumption on the predecessor node + // which will be caught in the next VisitNode() iteration as a 'PostStmt'. + const ProgramPointTag *PreviousNodeTag = + N->getFirstPred()->getLocation().getTag(); + if (PreviousNodeTag == Tags.first || PreviousNodeTag == Tags.second) + return nullptr; + + return VisitTerminator(Term, N, SrcBlock, BE->getDst(), BR, BRC); + } return nullptr; } - if (Optional PS = progPoint.getAs()) { - const std::pair &tags = - ExprEngine::geteagerlyAssumeBinOpBifurcationTags(); - - const ProgramPointTag *tag = PS->getTag(); - if (tag == tags.first) - return VisitTrueTest(cast(PS->getStmt()), true, - BRC, BR, N); - if (tag == tags.second) - return VisitTrueTest(cast(PS->getStmt()), false, - BRC, BR, N); + if (Optional PS = ProgPoint.getAs()) { + const ProgramPointTag *CurrentNodeTag = PS->getTag(); + if (CurrentNodeTag != Tags.first && CurrentNodeTag != Tags.second) + return nullptr; - return nullptr; + bool TookTrue = CurrentNodeTag == Tags.first; + return VisitTrueTest(cast(PS->getStmt()), BRC, BR, N, TookTrue); } return nullptr; @@ -1923,30 +1947,30 @@ assert(Cond); assert(srcBlk->succ_size() == 2); - const bool tookTrue = *(srcBlk->succ_begin()) == dstBlk; - return VisitTrueTest(Cond, tookTrue, BRC, R, N); + const bool TookTrue = *(srcBlk->succ_begin()) == dstBlk; + return VisitTrueTest(Cond, BRC, R, N, TookTrue); } std::shared_ptr -ConditionBRVisitor::VisitTrueTest(const Expr *Cond, bool tookTrue, - BugReporterContext &BRC, BugReport &R, - const ExplodedNode *N) { +ConditionBRVisitor::VisitTrueTest(const Expr *Cond, BugReporterContext &BRC, + BugReport &R, const ExplodedNode *N, + bool TookTrue) { ProgramStateRef CurrentState = N->getState(); - ProgramStateRef PreviousState = N->getFirstPred()->getState(); + ProgramStateRef PrevState = N->getFirstPred()->getState(); const LocationContext *LCtx = N->getLocationContext(); // If the constraint information is changed between the current and the // previous program state we assuming the newly seen constraint information. // If we cannot evaluate the condition (and the constraints are the same) // the analyzer has no information about the value and just assuming it. - if (BRC.getStateManager().haveEqualConstraints(CurrentState, PreviousState) && - CurrentState->getSVal(Cond, LCtx).isValid()) - return nullptr; + bool IsAssuming = + !BRC.getStateManager().haveEqualConstraints(CurrentState, PrevState) || + CurrentState->getSVal(Cond, LCtx).isUnknownOrUndef(); // These will be modified in code below, but we need to preserve the original // values in case we want to throw the generic message. const Expr *CondTmp = Cond; - bool tookTrueTmp = tookTrue; + bool TookTrueTmp = TookTrue; while (true) { CondTmp = CondTmp->IgnoreParenCasts(); @@ -1955,18 +1979,18 @@ break; case Stmt::BinaryOperatorClass: if (auto P = VisitTrueTest(Cond, cast(CondTmp), - tookTrueTmp, BRC, R, N)) + BRC, R, N, TookTrueTmp, IsAssuming)) return P; break; case Stmt::DeclRefExprClass: if (auto P = VisitTrueTest(Cond, cast(CondTmp), - tookTrueTmp, BRC, R, N)) + BRC, R, N, TookTrueTmp, IsAssuming)) return P; break; case Stmt::UnaryOperatorClass: { const auto *UO = cast(CondTmp); if (UO->getOpcode() == UO_LNot) { - tookTrueTmp = !tookTrueTmp; + TookTrueTmp = !TookTrueTmp; CondTmp = UO->getSubExpr(); continue; } @@ -1978,12 +2002,17 @@ // Condition too complex to explain? Just say something so that the user // knew we've made some path decision at this point. + // If it is too complex and we know the evaluation of the condition do not + // repeat the note from 'BugReporter.cpp' + if (!IsAssuming) + return nullptr; + PathDiagnosticLocation Loc(Cond, BRC.getSourceManager(), LCtx); if (!Loc.isValid() || !Loc.asLocation().isValid()) return nullptr; return std::make_shared( - Loc, tookTrue ? GenericTrueMessage : GenericFalseMessage); + Loc, TookTrue ? GenericTrueMessage : GenericFalseMessage); } bool ConditionBRVisitor::patternMatch(const Expr *Ex, @@ -2082,10 +2111,9 @@ return false; } -std::shared_ptr -ConditionBRVisitor::VisitTrueTest(const Expr *Cond, const BinaryOperator *BExpr, - const bool tookTrue, BugReporterContext &BRC, - BugReport &R, const ExplodedNode *N) { +std::shared_ptr ConditionBRVisitor::VisitTrueTest( + const Expr *Cond, const BinaryOperator *BExpr, BugReporterContext &BRC, + BugReport &R, const ExplodedNode *N, bool TookTrue, bool IsAssuming) { bool shouldInvert = false; Optional shouldPrune; @@ -2105,8 +2133,8 @@ if (BinaryOperator::isAssignmentOp(Op)) { // For assignment operators, all that we care about is that the LHS // evaluates to "true" or "false". - return VisitConditionVariable(LhsString, BExpr->getLHS(), tookTrue, - BRC, R, N); + return VisitConditionVariable(LhsString, BExpr->getLHS(), BRC, R, N, + TookTrue); } // For non-assignment operations, we require that we can understand @@ -2118,7 +2146,8 @@ // Should we invert the strings if the LHS is not a variable name? SmallString<256> buf; llvm::raw_svector_ostream Out(buf); - Out << "Assuming " << (shouldInvert ? RhsString : LhsString) << " is "; + Out << (IsAssuming ? "Assuming " : "") + << (shouldInvert ? RhsString : LhsString) << " is "; // Do we need to invert the opcode? if (shouldInvert) @@ -2130,7 +2159,7 @@ case BO_GE: Op = BO_LE; break; } - if (!tookTrue) + if (!TookTrue) switch (Op) { case BO_EQ: Op = BO_NE; break; case BO_NE: Op = BO_EQ; break; @@ -2157,6 +2186,11 @@ Out << (shouldInvert ? LhsString : RhsString); const LocationContext *LCtx = N->getLocationContext(); PathDiagnosticLocation Loc(Cond, BRC.getSourceManager(), LCtx); + + // If we know the value create a pop-up note. + if (!IsAssuming) + return std::make_shared(Loc, Out.str()); + auto event = std::make_shared(Loc, Out.str()); if (shouldPrune.hasValue()) event->setPrunable(shouldPrune.getValue()); @@ -2164,8 +2198,8 @@ } std::shared_ptr ConditionBRVisitor::VisitConditionVariable( - StringRef LhsString, const Expr *CondVarExpr, const bool tookTrue, - BugReporterContext &BRC, BugReport &report, const ExplodedNode *N) { + StringRef LhsString, const Expr *CondVarExpr, BugReporterContext &BRC, + BugReport &report, const ExplodedNode *N, bool TookTrue) { // FIXME: If there's already a constraint tracker for this variable, // we shouldn't emit anything here (c.f. the double note in // test/Analysis/inlining/path-notes.c) @@ -2176,13 +2210,13 @@ QualType Ty = CondVarExpr->getType(); if (Ty->isPointerType()) - Out << (tookTrue ? "not null" : "null"); + Out << (TookTrue ? "not null" : "null"); else if (Ty->isObjCObjectPointerType()) - Out << (tookTrue ? "not nil" : "nil"); + Out << (TookTrue ? "not nil" : "nil"); else if (Ty->isBooleanType()) - Out << (tookTrue ? "true" : "false"); + Out << (TookTrue ? "true" : "false"); else if (Ty->isIntegralOrEnumerationType()) - Out << (tookTrue ? "non-zero" : "zero"); + Out << (TookTrue ? "non-zero" : "zero"); else return nullptr; @@ -2203,34 +2237,44 @@ return event; } -std::shared_ptr -ConditionBRVisitor::VisitTrueTest(const Expr *Cond, const DeclRefExpr *DR, - const bool tookTrue, BugReporterContext &BRC, - BugReport &report, const ExplodedNode *N) { - const auto *VD = dyn_cast(DR->getDecl()); +std::shared_ptr ConditionBRVisitor::VisitTrueTest( + const Expr *Cond, const DeclRefExpr *DRE, BugReporterContext &BRC, + BugReport &report, const ExplodedNode *N, bool TookTrue, bool IsAssuming) { + const auto *VD = dyn_cast(DRE->getDecl()); if (!VD) return nullptr; SmallString<256> Buf; llvm::raw_svector_ostream Out(Buf); - Out << "Assuming '" << VD->getDeclName() << "' is "; + Out << (IsAssuming ? "Assuming '" : "'") << VD->getDeclName() << "' is "; - QualType VDTy = VD->getType(); + QualType Ty = VD->getType(); - if (VDTy->isPointerType()) - Out << (tookTrue ? "non-null" : "null"); - else if (VDTy->isObjCObjectPointerType()) - Out << (tookTrue ? "non-nil" : "nil"); - else if (VDTy->isScalarType()) - Out << (tookTrue ? "not equal to 0" : "0"); - else + if (Ty->isPointerType()) + Out << (TookTrue ? "non-null" : "null"); + else if (Ty->isObjCObjectPointerType()) + Out << (TookTrue ? "non-nil" : "nil"); + else if (Ty->isScalarType()) { + Optional IntValue; + if (!IsAssuming) + IntValue = getConcreteIntegerValue(DRE, N); + + if (IsAssuming || !IntValue.hasValue()) + Out << (TookTrue ? "not equal to 0" : "0"); + else + Out << *IntValue.getValue(); + } else return nullptr; const LocationContext *LCtx = N->getLocationContext(); PathDiagnosticLocation Loc(Cond, BRC.getSourceManager(), LCtx); - auto event = std::make_shared(Loc, Out.str()); + // If we know the value create a pop-up note. + if (!IsAssuming) + return std::make_shared(Loc, Out.str()); + + auto event = std::make_shared(Loc, Out.str()); const ProgramState *state = N->getState().get(); if (const MemRegion *R = state->getLValue(VD, LCtx).getAsRegion()) { if (report.isInteresting(R)) Index: clang/test/Analysis/Inputs/expected-plists/NewDelete-path-notes.cpp.plist =================================================================== --- clang/test/Analysis/Inputs/expected-plists/NewDelete-path-notes.cpp.plist +++ clang/test/Analysis/Inputs/expected-plists/NewDelete-path-notes.cpp.plist @@ -90,6 +90,68 @@ file0 + end + + + line9 + col7 + file0 + + + line9 + col7 + file0 + + + + + + + kindpop-up + location + + line9 + col7 + file0 + + ranges + + + + line9 + col7 + file0 + + + line9 + col7 + file0 + + + + extended_message + 'p' is non-null + message + 'p' is non-null + + + kindcontrol + edges + + + start + + + line9 + col7 + file0 + + + line9 + col7 + file0 + + end Index: clang/test/Analysis/Inputs/expected-plists/cxx-for-range.cpp.plist =================================================================== --- clang/test/Analysis/Inputs/expected-plists/cxx-for-range.cpp.plist +++ clang/test/Analysis/Inputs/expected-plists/cxx-for-range.cpp.plist @@ -158,6 +158,68 @@ file0 + end + + + line11 + col9 + file0 + + + line11 + col9 + file0 + + + + + + + kindpop-up + location + + line11 + col9 + file0 + + ranges + + + + line11 + col9 + file0 + + + line11 + col14 + file0 + + + + extended_message + 'y' is not equal to 2 + message + 'y' is not equal to 2 + + + kindcontrol + edges + + + start + + + line11 + col9 + file0 + + + line11 + col9 + file0 + + end @@ -420,6 +482,68 @@ file0 + end + + + line11 + col9 + file0 + + + line11 + col9 + file0 + + + + + + + kindpop-up + location + + line11 + col9 + file0 + + ranges + + + + line11 + col9 + file0 + + + line11 + col14 + file0 + + + + extended_message + 'y' is equal to 2 + message + 'y' is equal to 2 + + + kindcontrol + edges + + + start + + + line11 + col9 + file0 + + + line11 + col9 + file0 + + end @@ -665,6 +789,68 @@ file0 + end + + + line32 + col7 + file0 + + + line32 + col10 + file0 + + + + + + + kindpop-up + location + + line32 + col7 + file0 + + ranges + + + + line32 + col7 + file0 + + + line32 + col10 + file0 + + + + extended_message + 'fail' is 1 + message + 'fail' is 1 + + + kindcontrol + edges + + + start + + + line32 + col7 + file0 + + + line32 + col10 + file0 + + end Index: clang/test/Analysis/Inputs/expected-plists/edges-new.mm.plist =================================================================== --- clang/test/Analysis/Inputs/expected-plists/edges-new.mm.plist +++ clang/test/Analysis/Inputs/expected-plists/edges-new.mm.plist @@ -2709,6 +2709,34 @@ + + kindpop-up + location + + line146 + col8 + file0 + + ranges + + + + line146 + col8 + file0 + + + line146 + col13 + file0 + + + + extended_message + 'i' is not equal to 1 + message + 'i' is not equal to 1 + kindcontrol edges @@ -2887,6 +2915,68 @@ file0 + end + + + line146 + col8 + file0 + + + line146 + col8 + file0 + + + + + + + kindpop-up + location + + line146 + col8 + file0 + + ranges + + + + line146 + col8 + file0 + + + line146 + col13 + file0 + + + + extended_message + 'i' is equal to 1 + message + 'i' is equal to 1 + + + kindcontrol + edges + + + start + + + line146 + col8 + file0 + + + line146 + col8 + file0 + + end @@ -3805,6 +3895,68 @@ file0 + end + + + line178 + col9 + file0 + + + line178 + col9 + file0 + + + + + + + kindpop-up + location + + line178 + col9 + file0 + + ranges + + + + line178 + col9 + file0 + + + line178 + col14 + file0 + + + + extended_message + 'i' is equal to 0 + message + 'i' is equal to 0 + + + kindcontrol + edges + + + start + + + line178 + col9 + file0 + + + line178 + col9 + file0 + + end @@ -3999,6 +4151,68 @@ file0 + end + + + line178 + col9 + file0 + + + line178 + col9 + file0 + + + + + + + kindpop-up + location + + line178 + col9 + file0 + + ranges + + + + line178 + col9 + file0 + + + line178 + col14 + file0 + + + + extended_message + 'i' is not equal to 0 + message + 'i' is not equal to 0 + + + kindcontrol + edges + + + start + + + line178 + col9 + file0 + + + line178 + col9 + file0 + + end @@ -4033,6 +4247,68 @@ file0 + end + + + line181 + col9 + file0 + + + line181 + col9 + file0 + + + + + + + kindpop-up + location + + line181 + col9 + file0 + + ranges + + + + line181 + col9 + file0 + + + line181 + col14 + file0 + + + + extended_message + 'i' is equal to 1 + message + 'i' is equal to 1 + + + kindcontrol + edges + + + start + + + line181 + col9 + file0 + + + line181 + col9 + file0 + + end @@ -7807,16 +8083,44 @@ - kindcontrol - edges - - - start - - - line267 - col18 - file0 + kindpop-up + location + + line267 + col18 + file0 + + ranges + + + + line267 + col18 + file0 + + + line267 + col22 + file0 + + + + extended_message + 'coin' is 0 + message + 'coin' is 0 + + + kindcontrol + edges + + + start + + + line267 + col18 + file0 line267 @@ -8658,6 +8962,34 @@ + + kindpop-up + location + + line285 + col12 + file0 + + ranges + + + + line285 + col12 + file0 + + + line285 + col12 + file0 + + + + extended_message + 'z' is 0 + message + 'z' is 0 + kindcontrol edges @@ -8997,6 +9329,68 @@ file0 + end + + + line294 + col7 + file0 + + + line294 + col7 + file0 + + + + + + + kindpop-up + location + + line294 + col7 + file0 + + ranges + + + + line294 + col7 + file0 + + + line294 + col7 + file0 + + + + extended_message + 'y' is null + message + 'y' is null + + + kindcontrol + edges + + + start + + + line294 + col7 + file0 + + + line294 + col7 + file0 + + end @@ -11585,6 +11979,68 @@ file0 + end + + + line457 + col9 + file0 + + + line457 + col9 + file0 + + + + + + + kindpop-up + location + + line457 + col9 + file0 + + ranges + + + + line457 + col9 + file0 + + + line457 + col14 + file0 + + + + extended_message + 'first' is 1 + message + 'first' is 1 + + + kindcontrol + edges + + + start + + + line457 + col9 + file0 + + + line457 + col9 + file0 + + end @@ -11784,6 +12240,68 @@ file0 + end + + + line457 + col9 + file0 + + + line457 + col9 + file0 + + + + + + + kindpop-up + location + + line457 + col9 + file0 + + ranges + + + + line457 + col9 + file0 + + + line457 + col14 + file0 + + + + extended_message + 'first' is 0 + message + 'first' is 0 + + + kindcontrol + edges + + + start + + + line457 + col9 + file0 + + + line457 + col9 + file0 + + end @@ -12049,6 +12567,68 @@ file0 + end + + + line457 + col9 + file0 + + + line457 + col9 + file0 + + + + + + + kindpop-up + location + + line457 + col9 + file0 + + ranges + + + + line457 + col9 + file0 + + + line457 + col14 + file0 + + + + extended_message + 'first' is 1 + message + 'first' is 1 + + + kindcontrol + edges + + + start + + + line457 + col9 + file0 + + + line457 + col9 + file0 + + end @@ -12514,18 +13094,80 @@ line457 - col5 + col5 + file0 + + + line457 + col6 + file0 + + + + + + + kindcontrol + edges + + + start + + + line457 + col5 + file0 + + + line457 + col6 + file0 + + + end + + + line457 + col9 file0 line457 - col6 + col9 file0 + + kindpop-up + location + + line457 + col9 + file0 + + ranges + + + + line457 + col9 + file0 + + + line457 + col14 + file0 + + + + extended_message + 'first' is 1 + message + 'first' is 1 + kindcontrol edges @@ -12535,12 +13177,12 @@ line457 - col5 + col9 file0 line457 - col6 + col9 file0 @@ -13106,6 +13748,68 @@ file0 + end + + + line457 + col9 + file0 + + + line457 + col9 + file0 + + + + + + + kindpop-up + location + + line457 + col9 + file0 + + ranges + + + + line457 + col9 + file0 + + + line457 + col14 + file0 + + + + extended_message + 'first' is 1 + message + 'first' is 1 + + + kindcontrol + edges + + + start + + + line457 + col9 + file0 + + + line457 + col9 + file0 + + end @@ -14587,6 +15291,68 @@ file0 + end + + + line457 + col9 + file0 + + + line457 + col9 + file0 + + + + + + + kindpop-up + location + + line457 + col9 + file0 + + ranges + + + + line457 + col9 + file0 + + + line457 + col14 + file0 + + + + extended_message + 'first' is 1 + message + 'first' is 1 + + + kindcontrol + edges + + + start + + + line457 + col9 + file0 + + + line457 + col9 + file0 + + end @@ -16195,6 +16961,68 @@ file0 + end + + + line457 + col9 + file0 + + + line457 + col9 + file0 + + + + + + + kindpop-up + location + + line457 + col9 + file0 + + ranges + + + + line457 + col9 + file0 + + + line457 + col14 + file0 + + + + extended_message + 'first' is 1 + message + 'first' is 1 + + + kindcontrol + edges + + + start + + + line457 + col9 + file0 + + + line457 + col9 + file0 + + end @@ -18028,6 +18856,68 @@ file0 + end + + + line457 + col9 + file0 + + + line457 + col9 + file0 + + + + + + + kindpop-up + location + + line457 + col9 + file0 + + ranges + + + + line457 + col9 + file0 + + + line457 + col14 + file0 + + + + extended_message + 'first' is 1 + message + 'first' is 1 + + + kindcontrol + edges + + + start + + + line457 + col9 + file0 + + + line457 + col9 + file0 + + end Index: clang/test/Analysis/Inputs/expected-plists/inline-plist.c.plist =================================================================== --- clang/test/Analysis/Inputs/expected-plists/inline-plist.c.plist +++ clang/test/Analysis/Inputs/expected-plists/inline-plist.c.plist @@ -518,12 +518,74 @@ end - line47 + line45 + col7 + file0 + + + line45 + col7 + file0 + + + + + + + kindpop-up + location + + line45 + col7 + file0 + + ranges + + + + line45 + col7 + file0 + + + line45 + col12 + file0 + + + + extended_message + 'p' is equal to null + message + 'p' is equal to null + + + kindcontrol + edges + + + start + + + line45 + col7 + file0 + + + line45 + col7 + file0 + + + end + + + line48 col5 file0 - line47 + line48 col16 file0 @@ -535,7 +597,7 @@ kindevent location - line47 + line48 col18 file0 @@ -543,12 +605,12 @@ - line47 + line48 col18 file0 - line47 + line48 col18 file0 @@ -564,7 +626,7 @@ kindevent location - line47 + line48 col5 file0 @@ -572,12 +634,12 @@ - line47 + line48 col5 file0 - line47 + line48 col19 file0 @@ -725,7 +787,7 @@ 38 39 45 - 47 + 48 @@ -736,7 +798,7 @@ kindevent location - line58 + line59 col3 file0 @@ -744,12 +806,12 @@ - line58 + line59 col3 file0 - line58 + line59 col8 file0 @@ -769,12 +831,12 @@ start - line58 + line59 col3 file0 - line58 + line59 col5 file0 @@ -782,12 +844,12 @@ end - line59 + line60 col3 file0 - line59 + line60 col3 file0 @@ -799,7 +861,7 @@ kindevent location - line59 + line60 col3 file0 @@ -807,12 +869,12 @@ - line59 + line60 col3 file0 - line61 + line62 col5 file0 @@ -828,7 +890,7 @@ kindevent location - line59 + line60 col3 file0 @@ -846,12 +908,12 @@ start - line59 + line60 col3 file0 - line59 + line60 col3 file0 @@ -859,12 +921,12 @@ end - line60 + line61 col5 file0 - line60 + line61 col5 file0 @@ -880,12 +942,12 @@ start - line60 + line61 col5 file0 - line60 + line61 col5 file0 @@ -893,12 +955,12 @@ end - line60 + line61 col8 file0 - line60 + line61 col8 file0 @@ -910,7 +972,7 @@ kindevent location - line60 + line61 col8 file0 @@ -918,12 +980,12 @@ - line60 + line61 col6 file0 - line60 + line61 col6 file0 @@ -944,7 +1006,7 @@ issue_hash_content_of_line_in_contexta2e7504f29818834127c44ba841f4da8 location - line60 + line61 col8 file0 @@ -952,10 +1014,10 @@ 0 - 57 58 59 60 + 61 @@ -970,12 +1032,12 @@ start - line66 + line67 col3 file0 - line66 + line67 col5 file0 @@ -983,12 +1045,12 @@ end - line66 + line67 col12 file0 - line66 + line67 col12 file0 @@ -1000,7 +1062,7 @@ kindevent location - line66 + line67 col12 file0 @@ -1008,12 +1070,12 @@ - line66 + line67 col12 file0 - line69 + line70 col5 file0 @@ -1029,7 +1091,7 @@ kindevent location - line66 + line67 col12 file0 @@ -1047,12 +1109,12 @@ start - line66 + line67 col12 file0 - line66 + line67 col12 file0 @@ -1060,12 +1122,12 @@ end - line67 + line68 col5 file0 - line67 + line68 col7 file0 @@ -1077,7 +1139,7 @@ kindevent location - line67 + line68 col5 file0 @@ -1085,12 +1147,12 @@ - line67 + line68 col5 file0 - line67 + line68 col10 file0 @@ -1110,12 +1172,12 @@ start - line67 + line68 col5 file0 - line67 + line68 col7 file0 @@ -1123,12 +1185,12 @@ end - line68 + line69 col5 file0 - line68 + line69 col10 file0 @@ -1140,7 +1202,7 @@ kindevent location - line68 + line69 col5 file0 @@ -1148,12 +1210,12 @@ - line68 + line69 col5 file0 - line68 + line69 col12 file0 @@ -1169,7 +1231,7 @@ kindevent location - line66 + line67 col12 file0 @@ -1177,12 +1239,12 @@ - line66 + line67 col12 file0 - line69 + line70 col5 file0 @@ -1202,12 +1264,12 @@ start - line66 + line67 col12 file0 - line66 + line67 col12 file0 @@ -1215,12 +1277,12 @@ end - line66 + line67 col3 file0 - line66 + line67 col5 file0 @@ -1232,7 +1294,7 @@ kindevent location - line66 + line67 col3 file0 @@ -1240,12 +1302,12 @@ - line66 + line67 col3 file0 - line66 + line67 col8 file0 @@ -1265,12 +1327,12 @@ start - line66 + line67 col3 file0 - line66 + line67 col5 file0 @@ -1278,12 +1340,12 @@ end - line70 + line71 col3 file0 - line70 + line71 col3 file0 @@ -1299,12 +1361,12 @@ start - line70 + line71 col3 file0 - line70 + line71 col3 file0 @@ -1312,12 +1374,12 @@ end - line70 + line71 col6 file0 - line70 + line71 col6 file0 @@ -1329,7 +1391,7 @@ kindevent location - line70 + line71 col6 file0 @@ -1337,12 +1399,12 @@ - line70 + line71 col4 file0 - line70 + line71 col4 file0 @@ -1366,7 +1428,7 @@ issue_hash_function_offset5 location - line70 + line71 col6 file0 @@ -1374,11 +1436,11 @@ 0 - 65 66 67 68 - 70 + 69 + 71 @@ -1393,12 +1455,12 @@ start - line74 + line75 col3 file0 - line74 + line75 col9 file0 @@ -1406,12 +1468,12 @@ end - line75 + line76 col3 file0 - line75 + line76 col3 file0 @@ -1423,7 +1485,7 @@ kindevent location - line75 + line76 col3 file0 @@ -1431,12 +1493,12 @@ - line75 + line76 col3 file0 - line77 + line78 col5 file0 @@ -1452,7 +1514,7 @@ kindevent location - line75 + line76 col3 file0 @@ -1470,12 +1532,12 @@ start - line75 + line76 col3 file0 - line75 + line76 col3 file0 @@ -1483,12 +1545,12 @@ end - line76 + line77 col5 file0 - line76 + line77 col5 file0 @@ -1500,7 +1562,7 @@ kindevent location - line76 + line77 col5 file0 @@ -1508,12 +1570,12 @@ - line76 + line77 col5 file0 - line76 + line77 col9 file0 @@ -1529,7 +1591,7 @@ kindevent location - line75 + line76 col3 file0 @@ -1537,12 +1599,12 @@ - line75 + line76 col3 file0 - line77 + line78 col5 file0 @@ -1562,12 +1624,12 @@ start - line75 + line76 col3 file0 - line75 + line76 col3 file0 @@ -1575,12 +1637,12 @@ end - line78 + line79 col3 file0 - line78 + line79 col3 file0 @@ -1596,12 +1658,12 @@ start - line78 + line79 col3 file0 - line78 + line79 col3 file0 @@ -1609,12 +1671,12 @@ end - line78 + line79 col6 file0 - line78 + line79 col6 file0 @@ -1626,7 +1688,7 @@ kindevent location - line78 + line79 col6 file0 @@ -1634,12 +1696,12 @@ - line78 + line79 col4 file0 - line78 + line79 col4 file0 @@ -1663,7 +1725,7 @@ issue_hash_function_offset5 location - line78 + line79 col6 file0 @@ -1671,11 +1733,11 @@ 0 - 73 74 75 76 - 78 + 77 + 79 @@ -1690,12 +1752,12 @@ start - line82 + line83 col3 file0 - line82 + line83 col5 file0 @@ -1703,12 +1765,12 @@ end - line83 + line84 col3 file0 - line83 + line84 col3 file0 @@ -1720,7 +1782,7 @@ kindevent location - line83 + line84 col3 file0 @@ -1728,12 +1790,12 @@ - line83 + line84 col3 file0 - line85 + line86 col7 file0 @@ -1749,7 +1811,7 @@ kindevent location - line83 + line84 col3 file0 @@ -1767,12 +1829,12 @@ start - line83 + line84 col3 file0 - line83 + line84 col3 file0 @@ -1780,12 +1842,12 @@ end - line84 + line85 col5 file0 - line84 + line85 col5 file0 @@ -1797,7 +1859,7 @@ kindevent location - line84 + line85 col5 file0 @@ -1805,12 +1867,12 @@ - line84 + line85 col5 file0 - line84 + line85 col10 file0 @@ -1826,7 +1888,7 @@ kindevent location - line83 + line84 col3 file0 @@ -1834,12 +1896,12 @@ - line83 + line84 col3 file0 - line85 + line86 col7 file0 @@ -1859,12 +1921,12 @@ start - line83 + line84 col3 file0 - line83 + line84 col3 file0 @@ -1872,12 +1934,12 @@ end - line86 + line87 col3 file0 - line86 + line87 col3 file0 @@ -1893,12 +1955,12 @@ start - line86 + line87 col3 file0 - line86 + line87 col3 file0 @@ -1906,12 +1968,12 @@ end - line86 + line87 col6 file0 - line86 + line87 col6 file0 @@ -1923,7 +1985,7 @@ kindevent location - line86 + line87 col6 file0 @@ -1931,12 +1993,12 @@ - line86 + line87 col4 file0 - line86 + line87 col4 file0 @@ -1960,7 +2022,7 @@ issue_hash_function_offset5 location - line86 + line87 col6 file0 @@ -1968,12 +2030,12 @@ 0 - 81 82 83 84 85 86 + 87 Index: clang/test/Analysis/Inputs/expected-plists/objc-radar17039661.m.plist =================================================================== --- clang/test/Analysis/Inputs/expected-plists/objc-radar17039661.m.plist +++ clang/test/Analysis/Inputs/expected-plists/objc-radar17039661.m.plist @@ -802,6 +802,68 @@ file0 + end + + + line38 + col11 + file0 + + + line38 + col20 + file0 + + + + + + + kindpop-up + location + + line38 + col11 + file0 + + ranges + + + + line38 + col11 + file0 + + + line38 + col37 + file0 + + + + extended_message + 'traitValue' is equal to 'newTraitValue' + message + 'traitValue' is equal to 'newTraitValue' + + + kindcontrol + edges + + + start + + + line38 + col11 + file0 + + + line38 + col20 + file0 + + end Index: clang/test/Analysis/Inputs/expected-plists/plist-macros-with-expansion.cpp.plist =================================================================== --- clang/test/Analysis/Inputs/expected-plists/plist-macros-with-expansion.cpp.plist +++ clang/test/Analysis/Inputs/expected-plists/plist-macros-with-expansion.cpp.plist @@ -5205,6 +5205,62 @@ + + kindpop-up + location + + line418 + col3 + file0 + + ranges + + + + line418 + col3 + file0 + + + line418 + col27 + file0 + + + + extended_message + 'A' is >= 0 + message + 'A' is >= 0 + + + kindpop-up + location + + line418 + col3 + file0 + + ranges + + + + line418 + col3 + file0 + + + line418 + col27 + file0 + + + + extended_message + 'B' is >= 0 + message + 'B' is >= 0 + kindevent location Index: clang/test/Analysis/Inputs/expected-plists/plist-macros.cpp.plist =================================================================== --- clang/test/Analysis/Inputs/expected-plists/plist-macros.cpp.plist +++ clang/test/Analysis/Inputs/expected-plists/plist-macros.cpp.plist @@ -1364,6 +1364,34 @@ + + kindpop-up + location + + line69 + col3 + file0 + + ranges + + + + line69 + col3 + file0 + + + line69 + col16 + file0 + + + + extended_message + 'p' is null + message + 'p' is null + kindevent location @@ -1525,7 +1553,7 @@ kindevent location - line83 + line87 col3 file0 @@ -1533,12 +1561,12 @@ - line83 + line87 col3 file0 - line83 + line87 col12 file0 @@ -1546,15 +1574,15 @@ depth0 extended_message - Passing null pointer value via 1st parameter 'a' + Passing value via 1st parameter 'a' message - Passing null pointer value via 1st parameter 'a' + Passing value via 1st parameter 'a' kindevent location - line83 + line87 col3 file0 @@ -1562,12 +1590,12 @@ - line83 + line87 col3 file0 - line83 + line87 col12 file0 @@ -1589,9 +1617,9 @@ depth1 extended_message - Entered call from 'test1' + Entered call from 'test2' message - Entered call from 'test1' + Entered call from 'test2' kindcontrol @@ -1645,6 +1673,69 @@ file0 + end + + + line77 + col7 + file0 + + + line77 + col7 + file0 + + + + + + + kindevent + location + + line77 + col7 + file0 + + ranges + + + + line77 + col7 + file0 + + + line77 + col7 + file0 + + + + depth1 + extended_message + Assuming 'a' is null + message + Assuming 'a' is null + + + kindcontrol + edges + + + start + + + line77 + col7 + file0 + + + line77 + col7 + file0 + + end @@ -1747,8 +1838,8 @@ 76 77 79 - 82 - 83 + 86 + 87 Index: clang/test/Analysis/Inputs/expected-plists/plist-output.m.plist =================================================================== --- clang/test/Analysis/Inputs/expected-plists/plist-output.m.plist +++ clang/test/Analysis/Inputs/expected-plists/plist-output.m.plist @@ -2495,6 +2495,34 @@ + + kindpop-up + location + + line96 + col8 + file0 + + ranges + + + + line96 + col8 + file0 + + + line96 + col13 + file0 + + + + extended_message + 'i' is not equal to 1 + message + 'i' is not equal to 1 + kindcontrol edges @@ -2673,6 +2701,68 @@ file0 + end + + + line96 + col8 + file0 + + + line96 + col8 + file0 + + + + + + + kindpop-up + location + + line96 + col8 + file0 + + ranges + + + + line96 + col8 + file0 + + + line96 + col13 + file0 + + + + extended_message + 'i' is equal to 1 + message + 'i' is equal to 1 + + + kindcontrol + edges + + + start + + + line96 + col8 + file0 + + + line96 + col8 + file0 + + end @@ -3446,6 +3536,34 @@ + + kindpop-up + location + + line127 + col9 + file0 + + ranges + + + + line127 + col9 + file0 + + + line127 + col14 + file0 + + + + extended_message + 'i' is not equal to 1 + message + 'i' is not equal to 1 + kindcontrol edges @@ -3624,6 +3742,68 @@ file0 + end + + + line127 + col9 + file0 + + + line127 + col9 + file0 + + + + + + + kindpop-up + location + + line127 + col9 + file0 + + ranges + + + + line127 + col9 + file0 + + + line127 + col14 + file0 + + + + extended_message + 'i' is equal to 1 + message + 'i' is equal to 1 + + + kindcontrol + edges + + + start + + + line127 + col9 + file0 + + + line127 + col9 + file0 + + end Index: clang/test/Analysis/Inputs/expected-plists/retain-release.m.objc.plist =================================================================== --- clang/test/Analysis/Inputs/expected-plists/retain-release.m.objc.plist +++ clang/test/Analysis/Inputs/expected-plists/retain-release.m.objc.plist @@ -9568,6 +9568,68 @@ file0 + end + + + line745 + col6 + file0 + + + line745 + col9 + file0 + + + + + + + kindpop-up + location + + line745 + col6 + file0 + + ranges + + + + line745 + col6 + file0 + + + line745 + col9 + file0 + + + + extended_message + 'name' is non-nil + message + 'name' is non-nil + + + kindcontrol + edges + + + start + + + line745 + col6 + file0 + + + line745 + col9 + file0 + + end @@ -10095,6 +10157,68 @@ file0 + end + + + line745 + col6 + file0 + + + line745 + col9 + file0 + + + + + + + kindpop-up + location + + line745 + col6 + file0 + + ranges + + + + line745 + col6 + file0 + + + line745 + col9 + file0 + + + + extended_message + 'name' is non-nil + message + 'name' is non-nil + + + kindcontrol + edges + + + start + + + line745 + col6 + file0 + + + line745 + col9 + file0 + + end @@ -26110,4 +26234,4 @@ /Volumes/Transcend/code/monorepo/llvm-project/clang/test/Analysis/retain-release.m - \ No newline at end of file + Index: clang/test/Analysis/Inputs/expected-plists/retain-release.m.objcpp.plist =================================================================== --- clang/test/Analysis/Inputs/expected-plists/retain-release.m.objcpp.plist +++ clang/test/Analysis/Inputs/expected-plists/retain-release.m.objcpp.plist @@ -9568,6 +9568,68 @@ file0 + end + + + line745 + col6 + file0 + + + line745 + col9 + file0 + + + + + + + kindpop-up + location + + line745 + col6 + file0 + + ranges + + + + line745 + col6 + file0 + + + line745 + col9 + file0 + + + + extended_message + 'name' is non-nil + message + 'name' is non-nil + + + kindcontrol + edges + + + start + + + line745 + col6 + file0 + + + line745 + col9 + file0 + + end @@ -10095,6 +10157,68 @@ file0 + end + + + line745 + col6 + file0 + + + line745 + col9 + file0 + + + + + + + kindpop-up + location + + line745 + col6 + file0 + + ranges + + + + line745 + col6 + file0 + + + line745 + col9 + file0 + + + + extended_message + 'name' is non-nil + message + 'name' is non-nil + + + kindcontrol + edges + + + start + + + line745 + col6 + file0 + + + line745 + col9 + file0 + + end @@ -26179,4 +26303,4 @@ /Volumes/Transcend/code/monorepo/llvm-project/clang/test/Analysis/retain-release.m - \ No newline at end of file + Index: clang/test/Analysis/NewDelete-path-notes.cpp =================================================================== --- clang/test/Analysis/NewDelete-path-notes.cpp +++ clang/test/Analysis/NewDelete-path-notes.cpp @@ -6,8 +6,8 @@ void test() { int *p = new int; // expected-note@-1 {{Memory is allocated}} - if (p) - // expected-note@-1 {{Taking true branch}} + if (p) // expected-note {{'p' is non-null}} + // expected-note@-1 {{Taking true branch}} delete p; // expected-note@-1 {{Memory is released}} Index: clang/test/Analysis/diagnostics/no-store-func-path-notes.c =================================================================== --- clang/test/Analysis/diagnostics/no-store-func-path-notes.c +++ clang/test/Analysis/diagnostics/no-store-func-path-notes.c @@ -5,7 +5,8 @@ void *memset(void *__s, int __c, size_t __n); int initializer1(int *p, int x) { - if (x) { // expected-note{{Taking false branch}} + if (x) { // expected-note{{'x' is 0}} + // expected-note@-1{{Taking false branch}} *p = 1; return 0; } else { @@ -30,7 +31,8 @@ static int global; int initializer2(int **p, int x) { - if (x) { // expected-note{{Taking false branch}} + if (x) { // expected-note{{'x' is 0}} + // expected-note@-1{{Taking false branch}} *p = &global; return 0; } else { @@ -47,7 +49,8 @@ } void initializer3(int *p, int param) { - if (param) // expected-note{{Taking false branch}} + if (param) // expected-note{{'param' is 0}} + // expected-note@-1{{Taking false branch}} *p = 0; } // expected-note{{Returning without writing to '*p'}} @@ -60,12 +63,14 @@ } void initializer4(int *p, int param) { - if (param) // expected-note{{Taking false branch}} + if (param) // expected-note{{'param' is 0}} + // expected-note@-1{{Taking false branch}} *p = 0; } // expected-note{{Returning without writing to '*p'}} void initializer5(int *p, int param) { - if (!param) // expected-note{{Taking false branch}} + if (!param) // expected-note{{'param' is 1}} + // expected-note@-1{{Taking false branch}} *p = 0; } // expected-note{{Returning without writing to '*p'}} @@ -95,7 +100,8 @@ } S; int initializer7(S *s, int param) { - if (param) { // expected-note{{Taking false branch}} + if (param) { // expected-note{{'param' is 0}} + // expected-note@-1{{Taking false branch}} s->x = 0; return 0; } Index: clang/test/Analysis/diagnostics/no-store-func-path-notes.cpp =================================================================== --- clang/test/Analysis/diagnostics/no-store-func-path-notes.cpp +++ clang/test/Analysis/diagnostics/no-store-func-path-notes.cpp @@ -1,7 +1,8 @@ // RUN: %clang_analyze_cc1 -x c++ -std=c++14 -analyzer-checker=core -analyzer-output=text -verify %s int initializer1(int &p, int x) { - if (x) { // expected-note{{Taking false branch}} + if (x) { // expected-note{{'x' is 0}} + // expected-note@-1{{Taking false branch}} p = 1; return 0; } else { @@ -19,7 +20,8 @@ struct S { int initialize(int *p, int param) { - if (param) { //expected-note{{Taking false branch}} + if (param) { // expected-note{{'param' is 0}} + // expected-note@-1{{Taking false branch}} *p = 1; return 1; } Index: clang/test/Analysis/diagnostics/no-store-func-path-notes.m =================================================================== --- clang/test/Analysis/diagnostics/no-store-func-path-notes.m +++ clang/test/Analysis/diagnostics/no-store-func-path-notes.m @@ -10,7 +10,8 @@ @implementation I - (int)initVar:(int *)var param:(int)param { - if (param) { // expected-note{{Taking false branch}} + if (param) { // expected-note{{'param' is 0}} + // expected-note@-1{{Taking false branch}} *var = 1; return 0; } @@ -22,14 +23,16 @@ int x; //expected-note{{'x' declared without an initial value}} int out = [i initVar:&x param:0]; //expected-note{{Calling 'initVar:param:'}} //expected-note@-1{{Returning from 'initVar:param:'}} - if (out) // expected-note{{Taking true branch}} + if (out) //expected-note{{'out' is 1}} + //expected-note@-1{{Taking true branch}} return x; //expected-warning{{Undefined or garbage value returned to caller}} //expected-note@-1{{Undefined or garbage value returned to caller}} return 0; } int initializer1(int *p, int x) { - if (x) { // expected-note{{Taking false branch}} + if (x) { // expected-note{{'x' is 0}} + // expected-note@-1{{Taking false branch}} *p = 1; return 0; } else { Index: clang/test/Analysis/inline-plist.c =================================================================== --- clang/test/Analysis/inline-plist.c +++ clang/test/Analysis/inline-plist.c @@ -43,7 +43,8 @@ } if (p == 0) { - // expected-note@-1 {{Taking true branch}} + // expected-note@-1 {{'p' is equal to null}} + // expected-note@-2 {{Taking true branch}} triggers_bug(p); // expected-note@-1 {{Passing null pointer value via 1st parameter 'p'}} // expected-note@-2 {{Calling 'triggers_bug'}} Index: clang/test/Analysis/osobject-retain-release.cpp =================================================================== --- clang/test/Analysis/osobject-retain-release.cpp +++ clang/test/Analysis/osobject-retain-release.cpp @@ -498,7 +498,8 @@ void check_dynamic_cast_null_branch(OSObject *obj) { OSArray *arr1 = OSArray::withCapacity(10); // expected-note{{Call to method 'OSArray::withCapacity' returns an OSObject}} OSArray *arr = OSDynamicCast(OSArray, obj); // expected-note{{Assuming dynamic cast returns null due to type mismatch}} - if (!arr) // expected-note{{Taking true branch}} + if (!arr) // expected-note{{'arr' is null}} + // expected-note@-1{{Taking true branch}} return; // expected-warning{{Potential leak of an object stored into 'arr1'}} // expected-note@-1{{Object leaked}} arr1->release(); Index: clang/test/Analysis/use-after-move.cpp =================================================================== --- clang/test/Analysis/use-after-move.cpp +++ clang/test/Analysis/use-after-move.cpp @@ -259,15 +259,19 @@ A a; if (i == 1) { #ifndef PEACEFUL - // expected-note@-2 {{Taking false branch}} + // expected-note@-2 {{'i' is not equal to 1}} // expected-note@-3 {{Taking false branch}} + // expected-note@-4 {{'i' is not equal to 1}} + // expected-note@-5 {{Taking false branch}} #endif std::move(a); } if (i == 2) { #ifndef PEACEFUL - // expected-note@-2 {{Taking false branch}} + // expected-note@-2 {{'i' is not equal to 2}} // expected-note@-3 {{Taking false branch}} + // expected-note@-4 {{'i' is not equal to 2}} + // expected-note@-5 {{Taking false branch}} #endif a = A(); a.foo(); @@ -312,9 +316,10 @@ if (i > 5) { a.foo(); #ifndef PEACEFUL - // expected-note@-3 {{Taking true branch}} - // expected-warning@-3 {{Method called on moved-from object 'a'}} - // expected-note@-4 {{Method called on moved-from object 'a'}} + // expected-note@-3 {{'i' is > 5}} + // expected-note@-4 {{Taking true branch}} + // expected-warning@-4 {{Method called on moved-from object 'a'}} + // expected-note@-5 {{Method called on moved-from object 'a'}} #endif } } @@ -670,7 +675,8 @@ A a, b; i > 0 ? (void)(b = std::move(a)) : a.bar(); // no-warning #ifndef PEACEFUL - // expected-note@-2 {{'?' condition is true}} + // expected-note@-2 {{'i' is > 0}} + // expected-note@-3 {{'?' condition is true}} #endif } // A variation on the theme above. Index: clang/test/Analysis/virtualcall.cpp =================================================================== --- clang/test/Analysis/virtualcall.cpp +++ clang/test/Analysis/virtualcall.cpp @@ -164,8 +164,10 @@ X(int i) { if (i > 0) { #if !PUREONLY - // expected-note-re@-2 {{{{^}}Taking true branch}} - // expected-note-re@-3 {{{{^}}Taking false branch}} + // expected-note-re@-2 {{{{^}}'i' is > 0}} + // expected-note-re@-3 {{{{^}}Taking true branch}} + // expected-note-re@-4 {{{{^}}'i' is <= 0}} + // expected-note-re@-5 {{{{^}}Taking false branch}} #endif X x(i - 1); #if !PUREONLY