diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-05-11 05:22:44 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-05-11 05:22:44 +0000 |
commit | be57cf41fb55b48e3f889787960b3ac2eb5e4dbd (patch) | |
tree | 3cc21f41170c47eb67fbc72e3c541b98356c1ba5 /test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp | |
parent | 6a24747beed797b2f1184c66ca45beb4db20eb08 (diff) |
PR9882: Fix noexcept to deal with dependent new, delete, calls, and
dynamic_cast correctly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131177 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp')
-rw-r--r-- | test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp b/test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp index 28ed62c71e..35a8b0f7d0 100644 --- a/test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp +++ b/test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp @@ -155,12 +155,16 @@ void gencon() { N(G3()); } +template <class T> void f(T&&) noexcept; template <typename T, bool b> void late() { B(b, typeid(*(T*)0)); B(b, T(1)); B(b, static_cast<T>(S2(0, 0))); B(b, S1() + T()); + P(f(T())); + P(new (0) T); + P(delete (T*)0); } struct S3 { virtual ~S3() throw(); @@ -168,9 +172,15 @@ struct S3 { explicit S3(int); S3(const S2&); }; +template <class T> T&& f2() noexcept; +template <typename T> +void late2() { + P(dynamic_cast<S3&>(f2<T&>())); +} void operator +(const S1&, float) throw(); void operator +(const S1&, const S3&); void tlate() { late<float, true>(); late<S3, false>(); + late2<S3>(); } |