diff options
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 d8fdd5a5a07a5..c4e9c907a37a3 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 fad8d0918d530..0a3a8bb250bc5 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 143d9f7cc877a..25316f8d51ee5 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; + }; +} |