summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/MicrosoftExtensions.cpp
blob: fb3107f44e979ea40b85c24a2a9de9fae68a33ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// RUN: %clang_cc1 %s -fsyntax-only -verify -fms-extensions -fexceptions


// ::type_info is predeclared with forward class declartion
void f(const type_info &a);

// The following three are all equivalent when ms-extensions are on
void foo() throw(int);
void foo() throw(int, long);
void foo() throw(...); 
void foo(); // expected-note {{previous declaration}}

// Only nothrow specification is treated specially.
void foo() throw(); // expected-error {{exception specification in declaration does not match previous declaration}}

// throw(...)
void r3();
void r3() throw(...);

void r6() throw(...);
void r6() throw(int); // okay

struct Base {
  virtual void f2();
  virtual void f3() throw(...);
};

struct Derived : Base {
  virtual void f2() throw(...);
  virtual void f3();
};

// __stdcall handling
struct M {
    int __stdcall addP();
    float __stdcall subtractP(); 
};

template<typename T> void h1(T (__stdcall M::* const )()) { }

void m1() {
  h1<int>(&M::addP);
  h1(&M::subtractP);
} 
OpenPOWER on IntegriCloud