diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2012-05-22 21:36:38 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2012-05-22 21:36:38 +0000 | 
| commit | e51da3eab6ad2d02fcd8f68bdaef22d33a855210 (patch) | |
| tree | 1bfa44f5a9427d658426ac7786a70741e36d1bc8 /test/SemaCXX/implicit-exception-spec.cpp | |
| parent | 6b9a6e390fbb92c40eb9c6ac9e7abbd88dd7a767 (diff) | |
Notes
Diffstat (limited to 'test/SemaCXX/implicit-exception-spec.cpp')
| -rw-r--r-- | test/SemaCXX/implicit-exception-spec.cpp | 37 | 
1 files changed, 35 insertions, 2 deletions
diff --git a/test/SemaCXX/implicit-exception-spec.cpp b/test/SemaCXX/implicit-exception-spec.cpp index 143d9f7cc877..25316f8d51ee 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; +  }; +}  | 
