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 | 35c8983c3373dd9e4251c7cff7628ec0bb5344be (patch) | |
| tree | 97ee58f5ce8ffa65dc512d7be99ce267776e1a01 /libcxxabi/test/catch_reference_nullptr.pass.cpp | |
| parent | cf9f422ba165b9269001ffb0dc5681ba13c047aa (diff) | |
| download | bcm5719-llvm-35c8983c3373dd9e4251c7cff7628ec0bb5344be.tar.gz bcm5719-llvm-35c8983c3373dd9e4251c7cff7628ec0bb5344be.zip | |
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.
llvm-svn: 292638
Diffstat (limited to 'libcxxabi/test/catch_reference_nullptr.pass.cpp')
| -rw-r--r-- | libcxxabi/test/catch_reference_nullptr.pass.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/libcxxabi/test/catch_reference_nullptr.pass.cpp b/libcxxabi/test/catch_reference_nullptr.pass.cpp index 3ab520f77b2..82a49df3817 100644 --- a/libcxxabi/test/catch_reference_nullptr.pass.cpp +++ b/libcxxabi/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); } |

