diff options
| author | Ted Kremenek <kremenek@apple.com> | 2014-03-20 06:07:35 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2014-03-20 06:07:35 +0000 |
| commit | 2766ad27e867c40378f2e5c18094594aa112b7b4 (patch) | |
| tree | bda98c5b5110b2c195cea12cd10945618777303b /clang/lib/Analysis | |
| parent | f3c93bb61b486d3b01de8d0b071688a35388474d (diff) | |
| download | bcm5719-llvm-2766ad27e867c40378f2e5c18094594aa112b7b4.tar.gz bcm5719-llvm-2766ad27e867c40378f2e5c18094594aa112b7b4.zip | |
[-Wunreachable-code] constexpr functions can be used as configuration values.
llvm-svn: 204308
Diffstat (limited to 'clang/lib/Analysis')
| -rw-r--r-- | clang/lib/Analysis/ReachableCode.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Analysis/ReachableCode.cpp b/clang/lib/Analysis/ReachableCode.cpp index c79a94b820c..ffe576cd052 100644 --- a/clang/lib/Analysis/ReachableCode.cpp +++ b/clang/lib/Analysis/ReachableCode.cpp @@ -139,6 +139,11 @@ static bool isConfigurationValue(const Stmt *S, S = Ex->IgnoreParenCasts(); switch (S->getStmtClass()) { + case Stmt::CallExprClass: { + const FunctionDecl *Callee = + dyn_cast_or_null<FunctionDecl>(cast<CallExpr>(S)->getCalleeDecl()); + return Callee ? Callee->isConstexpr() : false; + } case Stmt::DeclRefExprClass: { const DeclRefExpr *DR = cast<DeclRefExpr>(S); const ValueDecl *D = DR->getDecl(); |

