Fixes an 'unreachable code' warning by MSVC on certain opt settings in gtest-death-test_test.cc.
This commit is contained in:
parent
79e11d7c7d
commit
40604f891e
@ -110,6 +110,11 @@ void DieInside(const char* function) {
|
||||
// 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.
|
||||
//
|
||||
// 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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user