GRExprEngine::VisitDeclRefExpr without 'asLValue' being true).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82598
91177308-0d34-0410-b5e6-
96231b3b80d8
return;
} else if (const FunctionDecl* FD = dyn_cast<FunctionDecl>(D)) {
- assert(asLValue);
+ // This code is valid regardless of the value of 'isLValue'.
SVal V = ValMgr.getFunctionPointer(FD);
MakeNode(Dst, Ex, Pred, state->BindExpr(Ex, V),
ProgramPoint::PostLValueKind);
return y.width; // no-warning
}
+// PR 4988 - This test exhibits a case where a function can be referenced
+// when not explicitly used in an "lvalue" context (as far as the analyzer is
+// concerned). This previously triggered a crash due to an invalid assertion.
+void pr_4988(void) {
+ pr_4988; // expected-warning{{expression result unused}}
+}
+