Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.eh/throw2.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 // Submitted by Sebastian Ritterbusch <[email protected]>
5
6 #define ANY int // a class with a public constructor
7
8 void athrow(const ANY & e)
9 #if __cplusplus <= 201402L
10 throw(ANY) // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } }
11 #endif
12 {
13 throw e; // { dg-bogus "" } discarding const
14 }
15
16 int main(void)
17 {
18 athrow(ANY());
19 return 0;
20 }