diff options
author | Eric Fiselier <eric@efcs.ca> | 2017-01-20 19:34:19 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2017-01-20 19:34:19 +0000 |
commit | dc0e3f75fdea858aaaa4b4d3cc13ae2977ac48b3 (patch) | |
tree | 996e8b8644dda2b5cddc4c999ea8ad11de339f15 /test | |
parent | 0cbb1dae894eec86e0a2978d5a0f101f1761983c (diff) |
Fix catch_reference_nullptr.pass.cpp test for GCC.
This test contained an implicit conversion from nullptr to bool.
Clang warns about this but the test had supressed that warning.
However GCC diagnoses the same code as an error and requires
-fpermissive to accept it.
This patch fixes both the warning and the error by explicitly
converting the pointer to bool.
git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@292638 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/catch_reference_nullptr.pass.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/test/catch_reference_nullptr.pass.cpp b/test/catch_reference_nullptr.pass.cpp index 3ab520f..82a49df 100644 --- a/test/catch_reference_nullptr.pass.cpp +++ b/test/catch_reference_nullptr.pass.cpp @@ -12,12 +12,6 @@ #include <cassert> #include <cstdlib> -// Clang emits a warning on converting an object of type nullptr_t to bool, -// even in generic code. Suppress it. -#if defined(__clang__) -#pragma clang diagnostic ignored "-Wnull-conversion" -#endif - struct A {}; template<typename T, bool CanCatchNullptr> @@ -25,7 +19,7 @@ static void catch_nullptr_test() { try { throw nullptr; } catch (T &p) { - assert(CanCatchNullptr && !p); + assert(CanCatchNullptr && !static_cast<bool>(p)); } catch (...) { assert(!CanCatchNullptr); } |