diff options
author | dim <dim@FreeBSD.org> | 2012-05-22 21:36:38 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-05-22 21:36:38 +0000 |
commit | e6d4a67235c1e62e3e292b1a167c5c6b9610a706 (patch) | |
tree | 1bfa44f5a9427d658426ac7786a70741e36d1bc8 /test/SemaCXX | |
parent | 822bde9df508e0b9afac5e581b0d6ab403417a28 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | test/SemaCXX/cxx0x-initializer-references.cpp | 5 | ||||
-rw-r--r-- | test/SemaCXX/dependent-noexcept-unevaluated.cpp | 3 | ||||
-rw-r--r-- | test/SemaCXX/implicit-exception-spec.cpp | 37 |
3 files changed, 41 insertions, 4 deletions
diff --git a/test/SemaCXX/cxx0x-initializer-references.cpp b/test/SemaCXX/cxx0x-initializer-references.cpp index d8fdd5a..c4e9c90 100644 --- a/test/SemaCXX/cxx0x-initializer-references.cpp +++ b/test/SemaCXX/cxx0x-initializer-references.cpp @@ -85,3 +85,8 @@ namespace PR12182 { f({1, 2}); } } + +namespace PR12660 { + const int &i { 1 }; + struct S { S(int); } const &s { 2 }; +} diff --git a/test/SemaCXX/dependent-noexcept-unevaluated.cpp b/test/SemaCXX/dependent-noexcept-unevaluated.cpp index fad8d09..0a3a8bb 100644 --- a/test/SemaCXX/dependent-noexcept-unevaluated.cpp +++ b/test/SemaCXX/dependent-noexcept-unevaluated.cpp @@ -23,7 +23,7 @@ struct array { T data[N]; - void swap(array& a) noexcept(noexcept(::swap(declval<T&>(), declval<T&>()))); + void swap(array& a) noexcept(noexcept(swap(declval<T&>(), declval<T&>()))); }; struct DefaultOnly @@ -38,4 +38,3 @@ int main() { array<DefaultOnly, 1> a, b; } - 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; + }; +} |