Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/noexcept53.C

raw
1 // PR c++/86476 - noexcept-specifier is a complete-class context
2 // { dg-do compile { target c++11 } }
3
4 struct S {
5 void f1() noexcept(noexcept(fn()));
6 void f2() noexcept(noexcept(fnx()));
7 void fn();
8 void fnx() noexcept;
9 };
10
11 void
12 S::f1() noexcept // { dg-error "different exception specifier" }
13 {
14 }
15
16 void
17 S::f2() // { dg-error "different exception specifier" }
18 {
19 }
20
21 struct S2 {
22 void f1() noexcept(noexcept(nosuchfn())); // { dg-error "not declared in this scope" }
23 void f2() noexcept(noexcept(nothere)); // { dg-error "not declared in this scope" }
24 void f3() noexcept(noexcept(nosuchfn())) { } // { dg-error "not declared in this scope" }
25 void f4() noexcept(noexcept(nothere)) { } // { dg-error "not declared in this scope" }
26 };