[libcxx-commits] [libcxxabi] d9eb6c7 - [libc++abi] Remove workarounds for missing -Wno-exceptions on older GCCs

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Sep 3 11:23:34 PDT 2021


Author: Louis Dionne
Date: 2021-09-03T14:23:28-04:00
New Revision: d9eb6c7cf55f88b28bdc6edad2eb45d0d52dfa1a

URL: https://github.com/llvm/llvm-project/commit/d9eb6c7cf55f88b28bdc6edad2eb45d0d52dfa1a
DIFF: https://github.com/llvm/llvm-project/commit/d9eb6c7cf55f88b28bdc6edad2eb45d0d52dfa1a.diff

LOG: [libc++abi] Remove workarounds for missing -Wno-exceptions on older GCCs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97675 has now been resolved
in GCC 11, so we can remove those workarounds.

Differential Revision: https://reviews.llvm.org/D109188

Added: 
    

Modified: 
    libcxxabi/test/catch_class_03.pass.cpp
    libcxxabi/test/catch_class_04.pass.cpp
    libcxxabi/test/catch_ptr.pass.cpp
    libcxxabi/test/catch_ptr_02.pass.cpp
    libcxxabi/test/inherited_exception.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxxabi/test/catch_class_03.pass.cpp b/libcxxabi/test/catch_class_03.pass.cpp
index 0d00c7451e24c..aab25703d6301 100644
--- a/libcxxabi/test/catch_class_03.pass.cpp
+++ b/libcxxabi/test/catch_class_03.pass.cpp
@@ -14,23 +14,15 @@
 
 // UNSUPPORTED: no-exceptions
 
-// FIXME: GCC doesn't allow turning off the warning for exceptions being caught
-//        by earlier handlers, which this test is exercising. We have to disable
-//        warnings altogether to remove the error.
-//        See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97675.
-// ADDITIONAL_COMPILE_FLAGS: -Wno-error
+// Compilers emit warnings about exceptions of type 'Child' being caught by
+// an earlier handler of type 'Base'. Congrats, you've just diagnosed the
+// behavior under test.
+// ADDITIONAL_COMPILE_FLAGS: -Wno-exceptions
 
 #include <exception>
 #include <stdlib.h>
 #include <assert.h>
 
-// Clang emits  warnings about exceptions of type 'Child' being caught by
-// an earlier handler of type 'Base'. Congrats clang, you've just
-// diagnosed the behavior under test.
-#if defined(__clang__)
-#pragma clang diagnostic ignored "-Wexceptions"
-#endif
-
 struct B
 {
     static int count;

diff  --git a/libcxxabi/test/catch_class_04.pass.cpp b/libcxxabi/test/catch_class_04.pass.cpp
index 7946963e392bf..c6ed65661bf59 100644
--- a/libcxxabi/test/catch_class_04.pass.cpp
+++ b/libcxxabi/test/catch_class_04.pass.cpp
@@ -14,23 +14,15 @@
 
 // UNSUPPORTED: no-exceptions
 
-// FIXME: GCC doesn't allow turning off the warning for exceptions being caught
-//        by earlier handlers, which this test is exercising. We have to disable
-//        warnings altogether to remove the error.
-//        See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97675.
-// ADDITIONAL_COMPILE_FLAGS: -Wno-error
+// Compilers emit warnings about exceptions of type 'Child' being caught by
+// an earlier handler of type 'Base'. Congrats, you've just diagnosed the
+// behavior under test.
+// ADDITIONAL_COMPILE_FLAGS: -Wno-exceptions
 
 #include <exception>
 #include <stdlib.h>
 #include <assert.h>
 
-// Clang emits  warnings about exceptions of type 'Child' being caught by
-// an earlier handler of type 'Base'. Congrats clang, you've just
-// diagnosed the behavior under test.
-#if defined(__clang__)
-#pragma clang diagnostic ignored "-Wexceptions"
-#endif
-
 struct B
 {
     static int count;

diff  --git a/libcxxabi/test/catch_ptr.pass.cpp b/libcxxabi/test/catch_ptr.pass.cpp
index 7fac517db6739..2285aaf288f50 100644
--- a/libcxxabi/test/catch_ptr.pass.cpp
+++ b/libcxxabi/test/catch_ptr.pass.cpp
@@ -14,23 +14,15 @@
 
 // UNSUPPORTED: no-exceptions
 
-// FIXME: GCC doesn't allow turning off the warning for exceptions being caught
-//        by earlier handlers, which this test is exercising. We have to disable
-//        warnings altogether to remove the error.
-//        See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97675.
-// ADDITIONAL_COMPILE_FLAGS: -Wno-error
+// Compilers emit warnings about exceptions of type 'Child' being caught by
+// an earlier handler of type 'Base'. Congrats, you've just diagnosed the
+// behavior under test.
+// ADDITIONAL_COMPILE_FLAGS: -Wno-exceptions
 
 #include <exception>
 #include <stdlib.h>
 #include <assert.h>
 
-// Clang emits  warnings about exceptions of type 'Child' being caught by
-// an earlier handler of type 'Base'. Congrats clang, you've just
-// diagnosed the behavior under test.
-#if defined(__clang__)
-#pragma clang diagnostic ignored "-Wexceptions"
-#endif
-
 struct B
 {
     static int count;

diff  --git a/libcxxabi/test/catch_ptr_02.pass.cpp b/libcxxabi/test/catch_ptr_02.pass.cpp
index b849559ea42f6..41f0c7806e7de 100644
--- a/libcxxabi/test/catch_ptr_02.pass.cpp
+++ b/libcxxabi/test/catch_ptr_02.pass.cpp
@@ -8,24 +8,16 @@
 
 // UNSUPPORTED: no-exceptions
 
-// FIXME: GCC doesn't allow turning off the warning for exceptions being caught
-//        by earlier handlers, which this test is exercising. We have to disable
-//        warnings altogether to remove the error.
-//        See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97675.
-// ADDITIONAL_COMPILE_FLAGS: -Wno-error
+// Compilers emit warnings about exceptions of type 'Child' being caught by
+// an earlier handler of type 'Base'. Congrats, you've just diagnosed the
+// behavior under test.
+// ADDITIONAL_COMPILE_FLAGS: -Wno-exceptions
 
 // The fix for PR17222 made it in the dylib for macOS 10.10
 // XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.9
 
 #include <cassert>
 
-// Clang emits  warnings about exceptions of type 'Child' being caught by
-// an earlier handler of type 'Base'. Congrats clang, you've just
-// diagnosed the behavior under test.
-#if defined(__clang__)
-#pragma clang diagnostic ignored "-Wexceptions"
-#endif
-
 #if __cplusplus < 201103L
 #define DISABLE_NULLPTR_TESTS
 #endif

diff  --git a/libcxxabi/test/inherited_exception.pass.cpp b/libcxxabi/test/inherited_exception.pass.cpp
index ab3fc0785b58d..0be1d846cb545 100644
--- a/libcxxabi/test/inherited_exception.pass.cpp
+++ b/libcxxabi/test/inherited_exception.pass.cpp
@@ -26,18 +26,10 @@
 
 // UNSUPPORTED: no-exceptions
 
-// FIXME: GCC doesn't allow turning off the warning for exceptions being caught
-//        by earlier handlers, which this test is exercising. We have to disable
-//        warnings altogether to remove the error.
-//        See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97675.
-// ADDITIONAL_COMPILE_FLAGS: -Wno-error
-
-// Clang emits  warnings about exceptions of type 'Child' being caught by
-// an earlier handler of type 'Base'. Congrats clang, you've just
-// diagnosed the behavior under test.
-#if defined(__clang__)
-#pragma clang diagnostic ignored "-Wexceptions"
-#endif
+// Compilers emit warnings about exceptions of type 'Child' being caught by
+// an earlier handler of type 'Base'. Congrats, you've just diagnosed the
+// behavior under test.
+// ADDITIONAL_COMPILE_FLAGS: -Wno-exceptions
 
 #include <assert.h>
 


        


More information about the libcxx-commits mailing list