blob: 48d41941970e4cccc5a70d07eb17063d7754e986 [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};