From 6f375e5604590fc9c23d8a75176feb951de84211 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Wed, 16 Apr 2014 07:26:09 +0000 Subject: -Wunreachable-code: refine recognition of unreachable "sigil" to cope with implicit casts in C++. Fixes . llvm-svn: 206360 --- clang/lib/Analysis/ReachableCode.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'clang/lib/Analysis/ReachableCode.cpp') 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(S)) + S = Ex->IgnoreCasts(); + // Special case looking for the sigil '()' around an integer literal. if (const ParenExpr *PE = dyn_cast(S)) if (!PE->getLocStart().isMacroID()) @@ -146,7 +149,7 @@ static bool isConfigurationValue(const Stmt *S, IncludeIntegers, true); if (const Expr *Ex = dyn_cast(S)) - S = Ex->IgnoreParenCasts(); + S = Ex->IgnoreCasts(); bool IgnoreYES_NO = false; -- cgit v1.1