Skip to content

Commit 125c9cf

Browse files
authored
[clang] Add test for CWG593 (#87752)
[CWG593](https://cplusplus.github.io/CWG/issues/593.html) "Falling off the end of a destructor's function-try-block handler". As usual with CWG issues resolved as NAD, we test for status-quo confirmed by CWG.
1 parent 977c0a6 commit 125c9cf

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
lines changed

clang/test/CXX/drs/dr593.cpp

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// RUN: %clang_cc1 -std=c++98 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK
2+
// RUN: %clang_cc1 -std=c++11 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK
3+
// RUN: %clang_cc1 -std=c++14 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK
4+
// RUN: %clang_cc1 -std=c++17 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK
5+
// RUN: %clang_cc1 -std=c++20 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK
6+
// RUN: %clang_cc1 -std=c++23 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK
7+
// RUN: %clang_cc1 -std=c++2c %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK
8+
9+
#if __cplusplus == 199711L
10+
#define NOTHROW throw()
11+
#else
12+
#define NOTHROW noexcept(true)
13+
#endif
14+
15+
namespace dr593 { // dr593: 2.8
16+
17+
void f();
18+
void fence() NOTHROW;
19+
20+
struct A {
21+
~A() try {
22+
f();
23+
} catch (...) {
24+
fence();
25+
}
26+
};
27+
28+
void g() {
29+
A();
30+
}
31+
32+
} // namespace dr593
33+
34+
// CHECK: call void @dr593::fence()()
35+
// CHECK-NEXT: invoke void @__cxa_rethrow()

clang/test/CXX/drs/dr5xx.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,7 @@ namespace dr591 { // dr591: no
10981098
}
10991099

11001100
// dr592: na
1101-
// dr593 needs an IRGen test.
1101+
// dr593 is in dr593.cpp
11021102
// dr594: na
11031103

11041104
namespace dr595 { // dr595: dup 1330

clang/www/cxx_dr_status.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3600,7 +3600,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
36003600
<td><a href="https://cplusplus.github.io/CWG/issues/593.html">593</a></td>
36013601
<td>NAD</td>
36023602
<td>Falling off the end of a destructor's <I>function-try-block</I> handler</td>
3603-
<td class="unknown" align="center">Unknown</td>
3603+
<td class="full" align="center">Clang 2.8</td>
36043604
</tr>
36053605
<tr id="594">
36063606
<td><a href="https://cplusplus.github.io/CWG/issues/594.html">594</a></td>

0 commit comments

Comments
 (0)