diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-04-10 06:11:48 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-04-10 06:11:48 +0000 |
| commit | b7151b910ccaa3e513f17f6d6817bdf593e2a02b (patch) | |
| tree | 38874132f548010e4af290705c0b0f9104100cc5 /clang/test/CXX/except/except.spec | |
| parent | 924046f1ec3d0669acdd3d5842901664f23b56b8 (diff) | |
| download | bcm5719-llvm-b7151b910ccaa3e513f17f6d6817bdf593e2a02b.tar.gz bcm5719-llvm-b7151b910ccaa3e513f17f6d6817bdf593e2a02b.zip | |
Add support for computing the exception specification for an inheriting
constructor. This isn't quite perfect (as usual, we don't handle default
arguments correctly yet, and we don't deal with copy/move constructors for
arguments correctly either, but this will be fixed when we implement core issue
1351.
This completes our support for inheriting constructors.
llvm-svn: 179154
Diffstat (limited to 'clang/test/CXX/except/except.spec')
| -rw-r--r-- | clang/test/CXX/except/except.spec/p14.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/clang/test/CXX/except/except.spec/p14.cpp b/clang/test/CXX/except/except.spec/p14.cpp index 99ed2fdee19..dda69e9aad6 100644 --- a/clang/test/CXX/except/except.spec/p14.cpp +++ b/clang/test/CXX/except/except.spec/p14.cpp @@ -112,3 +112,26 @@ namespace rdar13017229 { Typo foo(); // expected-error{{unknown type name 'Typo'}} }; } + +namespace InhCtor { + template<int> struct X {}; + struct Base { + Base(X<0>) noexcept(true); + Base(X<1>) noexcept(false); + Base(X<2>) throw(X<2>); + template<typename T> Base(T) throw(T); + }; + template<typename T> struct Throw { + Throw() throw(T); + }; + struct Derived : Base, Throw<X<3>> { + using Base::Base; + Throw<X<4>> x; + }; + struct Test { + friend Derived::Derived(X<0>) throw(X<3>, X<4>); + friend Derived::Derived(X<1>) noexcept(false); + friend Derived::Derived(X<2>) throw(X<2>, X<3>, X<4>); + }; + static_assert(!noexcept(Derived{X<5>{}}), ""); +} |

