]> granicus.if.org Git - clang/commitdiff
Tweak location of diagnostic for -Wunreachable-code
authorTed Kremenek <kremenek@apple.com>
Thu, 16 Dec 2010 08:22:16 +0000 (08:22 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 16 Dec 2010 08:22:16 +0000 (08:22 +0000)
test due to recent changes to the CFG.  The
diagnostic is somewhat in the wrong place, but
the -Wunreachable-code diagnostic needs to be
revamped anyway since most of the diagnostics
in this test case are redundant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121961 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaCXX/warn-unreachable.cpp

index f5601cd2df08156e0065482d37a89047d8fb4c13..79af56298031aaa6ccf62b3699646ee95886713e 100644 (file)
@@ -39,8 +39,10 @@ void test2() {
 void test3() {
   halt()
     --;         // expected-warning {{will never be executed}}
-  halt()
-    ?           // expected-warning {{will never be executed}}
+  // FIXME: The unreachable part is just the '?', but really all of this
+  // code is unreachable and shouldn't be separately reported.
+  halt()        // expected-warning {{will never be executed}}
+    ? 
     dead() : dead();
   live(),
     float       // expected-warning {{will never be executed}}