Skip to content

Commit d9eb6c7

Browse files
committed
[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
1 parent adfd12e commit d9eb6c7

File tree

5 files changed

+20
-60
lines changed

5 files changed

+20
-60
lines changed

libcxxabi/test/catch_class_03.pass.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,15 @@
1414

1515
// UNSUPPORTED: no-exceptions
1616

17-
// FIXME: GCC doesn't allow turning off the warning for exceptions being caught
18-
// by earlier handlers, which this test is exercising. We have to disable
19-
// warnings altogether to remove the error.
20-
// See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97675.
21-
// ADDITIONAL_COMPILE_FLAGS: -Wno-error
17+
// Compilers emit warnings about exceptions of type 'Child' being caught by
18+
// an earlier handler of type 'Base'. Congrats, you've just diagnosed the
19+
// behavior under test.
20+
// ADDITIONAL_COMPILE_FLAGS: -Wno-exceptions
2221

2322
#include <exception>
2423
#include <stdlib.h>
2524
#include <assert.h>
2625

27-
// Clang emits warnings about exceptions of type 'Child' being caught by
28-
// an earlier handler of type 'Base'. Congrats clang, you've just
29-
// diagnosed the behavior under test.
30-
#if defined(__clang__)
31-
#pragma clang diagnostic ignored "-Wexceptions"
32-
#endif
33-
3426
struct B
3527
{
3628
static int count;

libcxxabi/test/catch_class_04.pass.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,15 @@
1414

1515
// UNSUPPORTED: no-exceptions
1616

17-
// FIXME: GCC doesn't allow turning off the warning for exceptions being caught
18-
// by earlier handlers, which this test is exercising. We have to disable
19-
// warnings altogether to remove the error.
20-
// See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97675.
21-
// ADDITIONAL_COMPILE_FLAGS: -Wno-error
17+
// Compilers emit warnings about exceptions of type 'Child' being caught by
18+
// an earlier handler of type 'Base'. Congrats, you've just diagnosed the
19+
// behavior under test.
20+
// ADDITIONAL_COMPILE_FLAGS: -Wno-exceptions
2221

2322
#include <exception>
2423
#include <stdlib.h>
2524
#include <assert.h>
2625

27-
// Clang emits warnings about exceptions of type 'Child' being caught by
28-
// an earlier handler of type 'Base'. Congrats clang, you've just
29-
// diagnosed the behavior under test.
30-
#if defined(__clang__)
31-
#pragma clang diagnostic ignored "-Wexceptions"
32-
#endif
33-
3426
struct B
3527
{
3628
static int count;

libcxxabi/test/catch_ptr.pass.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,15 @@
1414

1515
// UNSUPPORTED: no-exceptions
1616

17-
// FIXME: GCC doesn't allow turning off the warning for exceptions being caught
18-
// by earlier handlers, which this test is exercising. We have to disable
19-
// warnings altogether to remove the error.
20-
// See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97675.
21-
// ADDITIONAL_COMPILE_FLAGS: -Wno-error
17+
// Compilers emit warnings about exceptions of type 'Child' being caught by
18+
// an earlier handler of type 'Base'. Congrats, you've just diagnosed the
19+
// behavior under test.
20+
// ADDITIONAL_COMPILE_FLAGS: -Wno-exceptions
2221

2322
#include <exception>
2423
#include <stdlib.h>
2524
#include <assert.h>
2625

27-
// Clang emits warnings about exceptions of type 'Child' being caught by
28-
// an earlier handler of type 'Base'. Congrats clang, you've just
29-
// diagnosed the behavior under test.
30-
#if defined(__clang__)
31-
#pragma clang diagnostic ignored "-Wexceptions"
32-
#endif
33-
3426
struct B
3527
{
3628
static int count;

libcxxabi/test/catch_ptr_02.pass.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,16 @@
88

99
// UNSUPPORTED: no-exceptions
1010

11-
// FIXME: GCC doesn't allow turning off the warning for exceptions being caught
12-
// by earlier handlers, which this test is exercising. We have to disable
13-
// warnings altogether to remove the error.
14-
// See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97675.
15-
// ADDITIONAL_COMPILE_FLAGS: -Wno-error
11+
// Compilers emit warnings about exceptions of type 'Child' being caught by
12+
// an earlier handler of type 'Base'. Congrats, you've just diagnosed the
13+
// behavior under test.
14+
// ADDITIONAL_COMPILE_FLAGS: -Wno-exceptions
1615

1716
// The fix for PR17222 made it in the dylib for macOS 10.10
1817
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.9
1918

2019
#include <cassert>
2120

22-
// Clang emits warnings about exceptions of type 'Child' being caught by
23-
// an earlier handler of type 'Base'. Congrats clang, you've just
24-
// diagnosed the behavior under test.
25-
#if defined(__clang__)
26-
#pragma clang diagnostic ignored "-Wexceptions"
27-
#endif
28-
2921
#if __cplusplus < 201103L
3022
#define DISABLE_NULLPTR_TESTS
3123
#endif

libcxxabi/test/inherited_exception.pass.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,10 @@
2626

2727
// UNSUPPORTED: no-exceptions
2828

29-
// FIXME: GCC doesn't allow turning off the warning for exceptions being caught
30-
// by earlier handlers, which this test is exercising. We have to disable
31-
// warnings altogether to remove the error.
32-
// See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97675.
33-
// ADDITIONAL_COMPILE_FLAGS: -Wno-error
34-
35-
// Clang emits warnings about exceptions of type 'Child' being caught by
36-
// an earlier handler of type 'Base'. Congrats clang, you've just
37-
// diagnosed the behavior under test.
38-
#if defined(__clang__)
39-
#pragma clang diagnostic ignored "-Wexceptions"
40-
#endif
29+
// Compilers emit warnings about exceptions of type 'Child' being caught by
30+
// an earlier handler of type 'Base'. Congrats, you've just diagnosed the
31+
// behavior under test.
32+
// ADDITIONAL_COMPILE_FLAGS: -Wno-exceptions
4133

4234
#include <assert.h>
4335

0 commit comments

Comments
 (0)