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 | c6587cc550f2252328d7db55fb4d700a4916b671 (patch) | |
tree | 38dcd0f6c4150b1c2c2237cf8d42e826781f8c6f /clang/test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp | |
parent | 2a09d65979bc4cf872d56fcc88a19e4fa0034c9e (diff) | |
download | bcm5719-llvm-c6587cc550f2252328d7db55fb4d700a4916b671.tar.gz bcm5719-llvm-c6587cc550f2252328d7db55fb4d700a4916b671.zip |
PR9882: Fix noexcept to deal with dependent new, delete, calls, and
dynamic_cast correctly.
llvm-svn: 131177
Diffstat (limited to 'clang/test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp')
-rw-r--r-- | clang/test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp b/clang/test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp index 28ed62c71ec..35a8b0f7d07 100644 --- a/clang/test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp +++ b/clang/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>(); } |