John McCall | 018591f | 2011-03-02 02:04:40 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify -fexceptions -fobjc-exceptions %s |
John McCall | 811d0be | 2010-05-28 08:37:35 +0000 | [diff] [blame] | 2 | |
John McCall | 018591f | 2011-03-02 02:04:40 +0000 | [diff] [blame^] | 3 | // Note that we're specifically excluding -fcxx-exceptions in the command line above. |
| 4 | |
| 5 | // That this should work even with -fobjc-exceptions is PR9358 |
John McCall | 811d0be | 2010-05-28 08:37:35 +0000 | [diff] [blame] | 6 | |
| 7 | // PR7243: redeclarations |
| 8 | namespace test0 { |
| 9 | void foo() throw(int); |
| 10 | void foo() throw(); |
| 11 | } |
| 12 | |
| 13 | // Overrides. |
| 14 | namespace test1 { |
| 15 | struct A { |
| 16 | virtual void foo() throw(); |
| 17 | }; |
| 18 | |
| 19 | struct B : A { |
| 20 | virtual void foo() throw(int); |
| 21 | }; |
| 22 | } |
| 23 | |
| 24 | // Calls from less permissive contexts. We don't actually do this |
| 25 | // check, but if we did it should also be disabled under |
| 26 | // -fno-exceptions. |
| 27 | namespace test2 { |
| 28 | void foo() throw(int); |
| 29 | void bar() throw() { |
| 30 | foo(); |
| 31 | } |
| 32 | } |
| 33 | |