Anders Carlsson | abea951 | 2011-02-28 00:40:07 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fcxx-exceptions -fexceptions -fsyntax-only -verify %s |
Mike Stump | 6ce0c39 | 2009-05-15 21:47:08 +0000 | [diff] [blame] | 2 | |
| 3 | int i; |
| 4 | |
| 5 | void foo() { |
| 6 | (throw,throw); |
| 7 | (1 ? throw 1 : throw 2); |
| 8 | throw int(1); |
| 9 | throw; |
| 10 | throw 1; |
| 11 | throw; |
| 12 | 1 ? throw : (void)42; |
Mike Stump | 8d28663 | 2009-05-16 04:31:34 +0000 | [diff] [blame] | 13 | __extension__ throw 1; // expected-error {{expected expression}} |
Mike Stump | 6ce0c39 | 2009-05-15 21:47:08 +0000 | [diff] [blame] | 14 | (void)throw; // expected-error {{expected expression}} |
| 15 | } |
Richard Smith | a971d24 | 2012-05-09 20:55:26 +0000 | [diff] [blame] | 16 | |
| 17 | void f() throw(static); // expected-error {{expected a type}} expected-error {{does not allow storage class}} |