summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/implicit-exception-spec.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-05-22 21:36:38 +0000
committerdim <dim@FreeBSD.org>2012-05-22 21:36:38 +0000
commite6d4a67235c1e62e3e292b1a167c5c6b9610a706 (patch)
tree1bfa44f5a9427d658426ac7786a70741e36d1bc8 /test/SemaCXX/implicit-exception-spec.cpp
parent822bde9df508e0b9afac5e581b0d6ab403417a28 (diff)
downloadFreeBSD-src-e6d4a67235c1e62e3e292b1a167c5c6b9610a706.zip
FreeBSD-src-e6d4a67235c1e62e3e292b1a167c5c6b9610a706.tar.gz
Vendor import of clang release_31 final r156748:
http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_31/final@156748
Diffstat (limited to 'test/SemaCXX/implicit-exception-spec.cpp')
-rw-r--r--test/SemaCXX/implicit-exception-spec.cpp37
1 files changed, 35 insertions, 2 deletions
diff --git a/test/SemaCXX/implicit-exception-spec.cpp b/test/SemaCXX/implicit-exception-spec.cpp
index 143d9f7..25316f8 100644
--- a/test/SemaCXX/implicit-exception-spec.cpp
+++ b/test/SemaCXX/implicit-exception-spec.cpp
@@ -40,9 +40,12 @@ namespace InClassInitializers {
}
namespace ExceptionSpecification {
- struct Nested {
+ // A type is permitted to be used in a dynamic exception specification when it
+ // is still being defined, but isn't complete within such an exception
+ // specification.
+ struct Nested { // expected-note {{not complete}}
struct T {
- T() noexcept(!noexcept(Nested())); // expected-error{{exception specification is not available until end of class definition}}
+ T() noexcept(!noexcept(Nested())); // expected-error{{incomplete type}}
} t;
};
}
@@ -54,3 +57,33 @@ namespace DefaultArgument {
} t; // expected-note {{has no default constructor}}
};
}
+
+namespace ImplicitDtorExceptionSpec {
+ struct A {
+ virtual ~A();
+
+ struct Inner {
+ ~Inner() throw();
+ };
+ Inner inner;
+ };
+
+ struct B {
+ virtual ~B() {} // expected-note {{here}}
+ };
+
+ struct C : B {
+ virtual ~C() {}
+ A a;
+ };
+
+ struct D : B {
+ ~D(); // expected-error {{more lax than base}}
+ struct E {
+ ~E();
+ struct F {
+ ~F() throw(A);
+ } f;
+ } e;
+ };
+}
OpenPOWER on IntegriCloud