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 | 0b0ca4724d1c05dc0dd1d6e5aff4c8a439cbb1a2 (patch) | |
tree | 2e1c25d80a72556d12393c2ecf3caebbf2de7d9e /test/CXX | |
parent | 0baaabb7174c8e512ea52bc36687dc31ff68b09f (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179154 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX')
-rw-r--r-- | test/CXX/except/except.spec/p14.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/CXX/except/except.spec/p14.cpp b/test/CXX/except/except.spec/p14.cpp index 99ed2fdee1..dda69e9aad 100644 --- a/test/CXX/except/except.spec/p14.cpp +++ b/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>{}}), ""); +} |