Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.eh/catch1.C

raw
1 // { dg-do assemble }
2 // Explicit { dg-require-effective-target exceptions_enabled } to avoid verify compiler messages FAILs for '-fno-exceptions'.
3 //
4 // Copyright (C) 1999 Free Software Foundation, Inc.
5 // Contributed by Nathan Sidwell 6 Jun 1999 <[email protected]>
6
7 // We cannot catch an incomplete type, or ptr to one
8
9 struct A; // { dg-message "" } forward decl
10
11 void fn()
12 {
13 try {}
14 catch (A *p) {} // { dg-error "" } undefined type
15 try {}
16 catch (A p) {} // { dg-error "" } undefined type
17 try {}
18 catch (void const *p) {} // ok
19 }