145
|
1 // PR c++/86476 - noexcept-specifier is a complete-class context
|
|
2 // { dg-do compile { target c++11 } }
|
|
3
|
|
4 void f() noexcept(false);
|
|
5 void g() noexcept(true);
|
|
6 void h() noexcept;
|
|
7
|
|
8 struct B {
|
|
9 friend void f() noexcept(false);
|
|
10 friend void g() noexcept(false); // { dg-error "different exception specifier" }
|
|
11 friend void h() noexcept(false); // { dg-error "different exception specifier" }
|
|
12 };
|
|
13
|
|
14 struct C {
|
|
15 friend void f() noexcept(true); // { dg-error "different exception specifier" }
|
|
16 friend void g() noexcept(true); // { dg-error "different exception specifier" }
|
|
17 friend void h() noexcept(true); // { dg-error "different exception specifier" }
|
|
18 };
|
|
19
|
|
20 void o() noexcept(false);
|
|
21 void p() noexcept(true);
|
|
22 void q() noexcept;
|
|
23
|
|
24 struct D {
|
|
25 friend void o() noexcept(true); // { dg-error "different exception specifier" }
|
|
26 friend void p() noexcept(true);
|
|
27 friend void q() noexcept(true);
|
|
28 };
|