Fixes an 'unreachable code' warning by MSVC on certain opt settings in gtest-death-test_test.cc.
git-svn-id: http://googletest.googlecode.com/svn/trunk@392 861a406c-534a-0410-8894-cb66d6ee9925
diff --git a/test/gtest-death-test_test.cc b/test/gtest-death-test_test.cc
index c57d700..ed5b53b 100644
--- a/test/gtest-death-test_test.cc
+++ b/test/gtest-death-test_test.cc
@@ -110,7 +110,12 @@
// system call and thus safer in the presence of threads. exit()
// will invoke user-defined exit-hooks, which may do dangerous
// things that conflict with death tests.
- _exit(1);
+ //
+ // Some compilers can recognize that _exit() never returns and issue the
+ // 'unreachable code' warning for code following this function, unless
+ // fooled by a fake condition.
+ if (AlwaysTrue())
+ _exit(1);
}
// Tests that death tests work.