diff options
author | Hans Wennborg <hans@hanshq.net> | 2017-02-01 21:30:36 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2017-02-01 21:30:36 +0000 |
commit | c4e6c8a10dea6f569fa99d56945ec1eba4be40dd (patch) | |
tree | 300ad1ccc6f6094133ab9d98648f9759db3bf9ed | |
parent | c980f401c96324d8d5210fbbf9ba64154a740e7b (diff) |
Merging r292638:release_40
------------------------------------------------------------------------
r292638 | ericwf | 2017-01-20 11:34:19 -0800 (Fri, 20 Jan 2017) | 9 lines
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/branches/release_40@293813 91177308-0d34-0410-b5e6-96231b3b80d8
-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); } |