]> granicus.if.org Git - clang/commit
[-Wunreachable-code] don't warn about dead 'return <string literal>' dominated by...
authorTed Kremenek <kremenek@apple.com>
Thu, 6 Mar 2014 06:50:46 +0000 (06:50 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 6 Mar 2014 06:50:46 +0000 (06:50 +0000)
commit516e77b4bd80d0682f9166563524724cc171b5a1
tree039f616db9e457976e68b326f9b961d805f1c68b
parent3c85413c1b54daf540c7053388f1f77adedec27b
[-Wunreachable-code] don't warn about dead 'return <string literal>' dominated by a 'noreturn' call, where literal becomes an std::string.

I have mixed feelings about this one.  It's used all over the codebase,
and is analogous to the current heuristic for ordinary C string literals.

This requires some ad hoc pattern matching of the AST.  While the
test case mirrors what we see std::string in libc++, it's not really
testing the libc++ headers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203091 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ReachableCode.cpp
test/SemaCXX/warn-unreachable.cpp