aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Analysis/ReachableCode.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2014-04-16 07:26:09 +0000
committerTed Kremenek <kremenek@apple.com>2014-04-16 07:26:09 +0000
commit6f375e5604590fc9c23d8a75176feb951de84211 (patch)
treea061ed0d5b01dacd33ee93addc23c1468e42af47 /clang/lib/Analysis/ReachableCode.cpp
parent057094c6f6bfacf22808ff7f70e895616d9474cc (diff)
downloadllvm-6f375e5604590fc9c23d8a75176feb951de84211.zip
llvm-6f375e5604590fc9c23d8a75176feb951de84211.tar.gz
llvm-6f375e5604590fc9c23d8a75176feb951de84211.tar.bz2
-Wunreachable-code: refine recognition of unreachable "sigil" to cope with implicit casts in C++.
Fixes <rdar://problem/16631033>. llvm-svn: 206360
Diffstat (limited to 'clang/lib/Analysis/ReachableCode.cpp')
-rw-r--r--clang/lib/Analysis/ReachableCode.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Analysis/ReachableCode.cpp b/clang/lib/Analysis/ReachableCode.cpp
index 3cc8ae4..8be1af7 100644
--- a/clang/lib/Analysis/ReachableCode.cpp
+++ b/clang/lib/Analysis/ReachableCode.cpp
@@ -139,6 +139,9 @@ static bool isConfigurationValue(const Stmt *S,
if (!S)
return false;
+ if (const Expr *Ex = dyn_cast<Expr>(S))
+ S = Ex->IgnoreCasts();
+
// Special case looking for the sigil '()' around an integer literal.
if (const ParenExpr *PE = dyn_cast<ParenExpr>(S))
if (!PE->getLocStart().isMacroID())
@@ -146,7 +149,7 @@ static bool isConfigurationValue(const Stmt *S,
IncludeIntegers, true);
if (const Expr *Ex = dyn_cast<Expr>(S))
- S = Ex->IgnoreParenCasts();
+ S = Ex->IgnoreCasts();
bool IgnoreYES_NO = false;