Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/cpp0x/noexcept47.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
1 // PR c++/86476 - noexcept-specifier is a complete-class context | |
2 // { dg-do compile { target c++11 } } | |
3 | |
4 int fn1 (); | |
5 int fn2 () noexcept; | |
6 int fn3 () noexcept; | |
7 | |
8 void g() noexcept(noexcept (fn2())); | |
9 | |
10 struct S1 { | |
11 friend void g1() noexcept(noexcept(fn2())); | |
12 friend void g1() noexcept(noexcept(fn1())); // { dg-error "different exception specifier" } | |
13 }; | |
14 | |
15 struct S2 { | |
16 friend void g2() noexcept(noexcept(fn1())); | |
17 friend void g2() noexcept(noexcept(fn1())); | |
18 friend void g2() noexcept(noexcept(fn1())); | |
19 }; | |
20 | |
21 struct S3 { | |
22 friend void g3() noexcept(noexcept(fn1())); | |
23 friend void g3() noexcept(noexcept(fn3())); // { dg-error "different exception specifier" } | |
24 }; | |
25 | |
26 struct S4 { | |
27 friend void g4() noexcept(noexcept(fn2())); | |
28 friend void g4() noexcept(noexcept(fn3())); | |
29 }; | |
30 | |
31 struct S5 { | |
32 friend void g() noexcept(noexcept(fn3())); | |
33 }; | |
34 | |
35 struct S6 { | |
36 friend void g() noexcept(noexcept(fn1())); // { dg-error "different exception specifier" } | |
37 }; | |
38 | |
39 struct S7 { | |
40 friend void gg() noexcept(noexcept(fn3())); | |
41 }; | |
42 | |
43 void gg() noexcept(noexcept(fn1())); // { dg-error "different exception specifier" } | |
44 | |
45 struct S8 { | |
46 friend void g8(); | |
47 friend void g8() noexcept(noexcept(fn2())); // { dg-error "different exception specifier" } | |
48 }; | |
49 | |
50 struct S9 { | |
51 friend void g9(); | |
52 friend void g9() noexcept(noexcept(fn1())); | |
53 }; | |
54 | |
55 struct S10 { | |
56 friend void g10() noexcept(noexcept(fn1())); | |
57 friend void g10(); | |
58 }; | |
59 | |
60 struct S11 { | |
61 friend void g11() noexcept(noexcept(fn2())); | |
62 friend void g11(); // { dg-error "different exception specifier" } | |
63 }; | |
64 | |
65 struct S12 { | |
66 friend void g12() noexcept(false); | |
67 friend void g12() noexcept(noexcept(fn2())); // { dg-error "different exception specifier" } | |
68 }; | |
69 | |
70 struct S13 { | |
71 friend void g13() noexcept(false); | |
72 friend void g13() noexcept(noexcept(fn1())); | |
73 }; | |
74 | |
75 struct S14 { | |
76 friend void g14() noexcept(noexcept(fn1())); | |
77 friend void g14() noexcept(false); | |
78 }; | |
79 | |
80 struct S15 { | |
81 friend void g15() noexcept(noexcept(fn2())); | |
82 friend void g15() noexcept(false); // { dg-error "different exception specifier" } | |
83 }; |