aboutsummaryrefslogtreecommitdiff
path: root/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
commit811d0bec4d4eb6a8ff373f97f98354d6e0e54ecb (patch)
treef8786274a29f2ca23e786fc43023d9d090d8e36e /test/SemaCXX/exception-spec-no-exceptions.cpp
parent1d0a5856d066f9030efbe3e0d9bbbb50ea597b99 (diff)
Disable exception-spec compatibility checking under -fno-exceptions.
Fixes PR7243. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104942 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/exception-spec-no-exceptions.cpp')
-rw-r--r--test/SemaCXX/exception-spec-no-exceptions.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/SemaCXX/exception-spec-no-exceptions.cpp b/test/SemaCXX/exception-spec-no-exceptions.cpp
new file mode 100644
index 0000000000..1fe45b0cff
--- /dev/null
+++ b/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();
+ }
+}
+