[llvm-commits] [llvm] r148645 - /llvm/trunk/utils/unittest/googletest/gtest.cc

David Blaikie dblaikie at gmail.com
Sat Jan 21 17:17:05 PST 2012


Author: dblaikie
Date: Sat Jan 21 19:17:04 2012
New Revision: 148645

URL: http://llvm.org/viewvc/llvm-project?rev=148645&view=rev
Log:
Help GCC along with code that's actually unreachable.

Unfortunately I don't think there's a fix for this that will work upstream and
also satisfy Clang's -Wunreachable-code, which is a pity. But I'll give it some
more thought -perhaps there's some way out.

Modified:
    llvm/trunk/utils/unittest/googletest/gtest.cc

Modified: llvm/trunk/utils/unittest/googletest/gtest.cc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/unittest/googletest/gtest.cc?rev=148645&r1=148644&r2=148645&view=diff
==============================================================================
--- llvm/trunk/utils/unittest/googletest/gtest.cc (original)
+++ llvm/trunk/utils/unittest/googletest/gtest.cc Sat Jan 21 19:17:04 2012
@@ -2481,6 +2481,9 @@
       return "Failure\n";
 #endif
   }
+
+  // All cases return, so this is unreachable but GCC doesn't know it
+  abort();
 }
 
 // Prints a TestPartResult to a String.





More information about the llvm-commits mailing list