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