Douglas Gregor | 5b6f769 | 2010-08-30 15:04:51 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -fsyntax-only -verify -fms-extensions -fexceptions |
Douglas Gregor | 5c0ca52 | 2010-08-30 14:44:26 +0000 | [diff] [blame] | 2 | |
| 3 | |
| 4 | // ::type_info is predeclared with forward class declartion |
| 5 | void f(const type_info &a); |
| 6 | |
Douglas Gregor | 5b6f769 | 2010-08-30 15:04:51 +0000 | [diff] [blame] | 7 | // The following three are all equivalent when ms-extensions are on |
| 8 | void foo() throw(int); |
| 9 | void foo() throw(int, long); |
| 10 | void foo() throw(...); |
| 11 | void foo(); // expected-note {{previous declaration}} |
Douglas Gregor | 5c0ca52 | 2010-08-30 14:44:26 +0000 | [diff] [blame] | 12 | |
Douglas Gregor | 5b6f769 | 2010-08-30 15:04:51 +0000 | [diff] [blame] | 13 | // Only nothrow specification is treated specially. |
| 14 | void foo() throw(); // expected-error {{exception specification in declaration does not match previous declaration}} |
| 15 | |
| 16 | // throw(...) |
| 17 | void r3(); |
| 18 | void r3() throw(...); |
| 19 | |
| 20 | void r6() throw(...); |
| 21 | void r6() throw(int); // okay |
| 22 | |
| 23 | struct Base { |
| 24 | virtual void f2(); |
| 25 | virtual void f3() throw(...); |
| 26 | }; |
| 27 | |
| 28 | struct Derived : Base { |
| 29 | virtual void f2() throw(...); |
| 30 | virtual void f3(); |
| 31 | }; |
Douglas Gregor | afac01d | 2010-09-01 16:29:03 +0000 | [diff] [blame] | 32 | |
| 33 | // __stdcall handling |
| 34 | struct M { |
| 35 | int __stdcall addP(); |
| 36 | float __stdcall subtractP(); |
| 37 | }; |
| 38 | |
| 39 | template<typename T> void h1(T (__stdcall M::* const )()) { } |
| 40 | |
| 41 | void m1() { |
| 42 | h1<int>(&M::addP); |
| 43 | h1(&M::subtractP); |
| 44 | } |