gcc/testsuite/g++.dg/eh/anon1.C
raw| 1 | // Test that the anonymous namespace isn't mangled with random characters, |
| 2 | // but also doesn't get mixed up with an anonymous namespace in another |
| 3 | // translation unit. |
| 4 | |
| 5 | // { dg-do run } |
| 6 | // { dg-additional-sources "anon1a.cc" } |
| 7 | |
| 8 | namespace { |
| 9 | struct A |
| 10 | { |
| 11 | virtual void f(); |
| 12 | }; |
| 13 | |
| 14 | void A::f() { } |
| 15 | } |
| 16 | |
| 17 | extern void g(); |
| 18 | |
| 19 | int main() |
| 20 | { |
| 21 | try { |
| 22 | try { |
| 23 | g(); |
| 24 | } catch (A) { __builtin_abort(); } |
| 25 | } catch (...) { } |
| 26 | } |