diff options
author | dim <dim@FreeBSD.org> | 2011-06-12 15:46:16 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-06-12 15:46:16 +0000 |
commit | c49018d9cce52d8c9f34b44865ec3ba8e89a1488 (patch) | |
tree | c5e9e10bc189de0058aa763c47b9920a8351b7df /test/CXX/expr/expr.unary | |
parent | 110eaaceddcec790f7e6a5e3bf1261c9aa1e73ab (diff) | |
download | FreeBSD-src-c49018d9cce52d8c9f34b44865ec3ba8e89a1488.zip FreeBSD-src-c49018d9cce52d8c9f34b44865ec3ba8e89a1488.tar.gz |
Vendor import of clang trunk r132879:
http://llvm.org/svn/llvm-project/cfe/trunk@132879
Diffstat (limited to 'test/CXX/expr/expr.unary')
-rw-r--r-- | test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp | 13 |
1 files changed, 13 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 28ed62c..6d1e523 100644 --- a/test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp +++ b/test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp @@ -97,6 +97,8 @@ struct Bad2 { void operator delete(void*) throw(int); }; +typedef int X; + void implicits() { N(new int); P(new (0) int); @@ -113,6 +115,7 @@ void implicits() { N(static_cast<int>(s)); P(static_cast<float>(s)); N(Bad1()); + P(X().~X()); } struct V { @@ -155,12 +158,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 +175,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>(); } |