summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/exception-spec-no-exceptions.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-05-28 08:37:35 +0000
committerJohn McCall <rjmccall@apple.com>2010-05-28 08:37:35 +0000
commitf9c94093f99fabbd6a4f116ae30fcc9ef155adad (patch)
tree6482744851051e3b9f64217232ffdf018052e722 /clang/test/SemaCXX/exception-spec-no-exceptions.cpp
parent2177a9b65a637e2c978e90f467c2d6fe07ac920e (diff)
downloadbcm5719-llvm-f9c94093f99fabbd6a4f116ae30fcc9ef155adad.tar.gz
bcm5719-llvm-f9c94093f99fabbd6a4f116ae30fcc9ef155adad.zip
Disable exception-spec compatibility checking under -fno-exceptions.
Fixes PR7243. llvm-svn: 104942
Diffstat (limited to 'clang/test/SemaCXX/exception-spec-no-exceptions.cpp')
-rw-r--r--clang/test/SemaCXX/exception-spec-no-exceptions.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/exception-spec-no-exceptions.cpp b/clang/test/SemaCXX/exception-spec-no-exceptions.cpp
new file mode 100644
index 00000000000..1fe45b0cffc
--- /dev/null
+++ b/clang/test/SemaCXX/exception-spec-no-exceptions.cpp
@@ -0,0 +1,32 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+// Note: this is intentionally -fno-exceptions, not just accidentally
+// so because that's the current -cc1 default.
+
+// PR7243: redeclarations
+namespace test0 {
+ void foo() throw(int);
+ void foo() throw();
+}
+
+// Overrides.
+namespace test1 {
+ struct A {
+ virtual void foo() throw();
+ };
+
+ struct B : A {
+ virtual void foo() throw(int);
+ };
+}
+
+// Calls from less permissive contexts. We don't actually do this
+// check, but if we did it should also be disabled under
+// -fno-exceptions.
+namespace test2 {
+ void foo() throw(int);
+ void bar() throw() {
+ foo();
+ }
+}
+
OpenPOWER on IntegriCloud