From: Ted Kremenek Date: Tue, 31 Aug 2010 18:47:34 +0000 (+0000) Subject: Explicitly handle CXXOperatorCallExpr when building CFGs. We should treat it the... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a427f1d8f0848997029d1bdc0c5c137f982f775d;p=clang Explicitly handle CXXOperatorCallExpr when building CFGs. We should treat it the same as CallExprs. Fixes: [Boost] CFGBuilder crash in Boost.Graph git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112618 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp index 78979a4fee..562763b8b4 100644 --- a/lib/Analysis/CFG.cpp +++ b/lib/Analysis/CFG.cpp @@ -370,6 +370,7 @@ tryAgain: return VisitBreakStmt(cast(S)); case Stmt::CallExprClass: + case Stmt::CXXOperatorCallExprClass: return VisitCallExpr(cast(S), asc); case Stmt::CaseStmtClass: @@ -393,7 +394,7 @@ tryAgain: case Stmt::CXXExprWithTemporariesClass: { // FIXME: Handle temporaries. For now, just visit the subexpression // so we don't artificially create extra blocks. - return Visit(cast(S)->getSubExpr()); + return Visit(cast(S)->getSubExpr(), asc); } case Stmt::CXXMemberCallExprClass: diff --git a/test/Analysis/misc-ps-region-store.cpp b/test/Analysis/misc-ps-region-store.cpp index baaa2f6cbd..bfa5e5cbb9 100644 --- a/test/Analysis/misc-ps-region-store.cpp +++ b/test/Analysis/misc-ps-region-store.cpp @@ -148,3 +148,14 @@ void pr7675_test() { *p = 0xDEADBEEF; // expected-warning{{null pointer}} } +// - CFGBuilder should handle temporaries. +struct R8375510 { + R8375510(); + ~R8375510(); + R8375510 operator++(int); +}; + +int r8375510(R8375510 x, R8375510 y) { + for (; ; x++) { } +} +