comparison libcxxabi/test/catch_ptr.pass.cpp @ 236:c4bab56944e8 llvm-original

LLVM 16
author kono
date Wed, 09 Nov 2022 17:45:10 +0900
parents 79ff65ed7e25
children
comparison
equal deleted inserted replaced
232:70dce7da266c 236:c4bab56944e8
1 //===---------------------- catch_class_04.cpp ----------------------------===// 1 //===----------------------------------------------------------------------===//
2 // 2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information. 4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 // 6 //
12 check against. It also checks that virtual bases work properly 12 check against. It also checks that virtual bases work properly
13 */ 13 */
14 14
15 // UNSUPPORTED: no-exceptions 15 // UNSUPPORTED: no-exceptions
16 16
17 // FIXME: GCC doesn't allow turning off the warning for exceptions being caught 17 // Compilers emit warnings about exceptions of type 'Child' being caught by
18 // by earlier handlers, which this test is exercising. We have to disable 18 // an earlier handler of type 'Base'. Congrats, you've just diagnosed the
19 // warnings altogether to remove the error. 19 // behavior under test.
20 // See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97675. 20 // ADDITIONAL_COMPILE_FLAGS: -Wno-exceptions
21 // ADDITIONAL_COMPILE_FLAGS: -Wno-error
22 21
23 #include <exception> 22 #include <exception>
24 #include <stdlib.h> 23 #include <stdlib.h>
25 #include <assert.h> 24 #include <assert.h>
26
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 25
34 struct B 26 struct B
35 { 27 {
36 static int count; 28 static int count;
37 int id_; 29 int id_;