Debian Codegraph @

gcc/testsuite/g++.dg/eh/spec6.C

raw
1 // Test that we don't allow incomplete types in an exception-specification
2 // for a definition, or at a call site.
3
4 // { dg-do compile { target c++14_down } }
5 // { dg-options "-fpermissive -w" }
6
7 struct A; // { dg-message "" }
8
9 struct B
10 {
11 void f () throw (A);
12 };
13
14 void B::f () throw (A) {} // { dg-error "A" }
15
16 int main ()
17 {
18 B b;
19 b.f(); // { dg-error "A" }
20 }