summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/MicrosoftExtensions.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-08-30 15:04:51 +0000
committerDouglas Gregor <dgregor@apple.com>2010-08-30 15:04:51 +0000
commitf62c5294c1213742e05ed3471a3d43991d825eb7 (patch)
tree7fbd13cd8c8662759ed43173da25465d8177672b /clang/test/SemaCXX/MicrosoftExtensions.cpp
parent759ef23bb86ecd18cff8d9732ec54b9cb6f608a9 (diff)
downloadbcm5719-llvm-f62c5294c1213742e05ed3471a3d43991d825eb7.tar.gz
bcm5719-llvm-f62c5294c1213742e05ed3471a3d43991d825eb7.zip
Emulate (some of) Microsoft's looser semantic checking of exception
specifications, from Martin Vejnar! llvm-svn: 112482
Diffstat (limited to 'clang/test/SemaCXX/MicrosoftExtensions.cpp')
-rw-r--r--clang/test/SemaCXX/MicrosoftExtensions.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/MicrosoftExtensions.cpp b/clang/test/SemaCXX/MicrosoftExtensions.cpp
index c143e59fb3e..48d41941970 100644
--- a/clang/test/SemaCXX/MicrosoftExtensions.cpp
+++ b/clang/test/SemaCXX/MicrosoftExtensions.cpp
@@ -1,7 +1,31 @@
-// RUN: %clang_cc1 %s -fsyntax-only -verify -fms-extensions
+// 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();
+};
OpenPOWER on IntegriCloud