summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/MicrosoftExtensions.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2010-09-17 15:54:40 +0000
committerdim <dim@FreeBSD.org>2010-09-17 15:54:40 +0000
commit36c49e3f258dced101949edabd72e9bc3f1dedc4 (patch)
tree0bbe07708f7571f8b5291f6d7b96c102b7c99dee /test/SemaCXX/MicrosoftExtensions.cpp
parentfc84956ac8b7cd244ef30e7a4d4d38a58dec5904 (diff)
downloadFreeBSD-src-36c49e3f258dced101949edabd72e9bc3f1dedc4.zip
FreeBSD-src-36c49e3f258dced101949edabd72e9bc3f1dedc4.tar.gz
Vendor import of clang r114020 (from the release_28 branch):
http://llvm.org/svn/llvm-project/cfe/branches/release_28@114020 Approved by: rpaulo (mentor)
Diffstat (limited to 'test/SemaCXX/MicrosoftExtensions.cpp')
-rw-r--r--test/SemaCXX/MicrosoftExtensions.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/SemaCXX/MicrosoftExtensions.cpp b/test/SemaCXX/MicrosoftExtensions.cpp
new file mode 100644
index 0000000..fb3107f
--- /dev/null
+++ b/test/SemaCXX/MicrosoftExtensions.cpp
@@ -0,0 +1,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