-Wunreachable-code: refine recognition of unreachable "sigil" to cope with implicit casts in C++.

Fixes <rdar://problem/16631033>.

llvm-svn: 206360
This commit is contained in:
Ted Kremenek
2014-04-16 07:26:09 +00:00
parent 057094c6f6
commit 6f375e5604
4 changed files with 63 additions and 1 deletions

View File

@@ -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;