diff options
author | dim <dim@FreeBSD.org> | 2013-12-22 00:07:40 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-12-22 00:07:40 +0000 |
commit | 952eddef9aff85b1e92626e89baaf7a360e2ac85 (patch) | |
tree | df8df0b0067b381eab470a3b8f28d14a552a6340 /test/CXX/expr/expr.prim/expr.prim.general | |
parent | ea266cad53e3d49771fa38103913d3ec7a166694 (diff) | |
download | FreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.zip FreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.tar.gz |
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
https://llvm.org/svn/llvm-project/cfe/branches/release_34@197841
Diffstat (limited to 'test/CXX/expr/expr.prim/expr.prim.general')
-rw-r--r-- | test/CXX/expr/expr.prim/expr.prim.general/p3-0x.cpp | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/test/CXX/expr/expr.prim/expr.prim.general/p3-0x.cpp b/test/CXX/expr/expr.prim/expr.prim.general/p3-0x.cpp index 6657991..fd90482 100644 --- a/test/CXX/expr/expr.prim/expr.prim.general/p3-0x.cpp +++ b/test/CXX/expr/expr.prim/expr.prim.general/p3-0x.cpp @@ -30,16 +30,44 @@ struct C { float &f(T*) const noexcept; T* ptr; - auto g1() noexcept(noexcept(f(ptr))) -> decltype(f((*this).ptr)); + auto g1() noexcept(noexcept(f(ptr))) -> decltype(f(ptr)); auto g2() const noexcept(noexcept(f(((this))->ptr))) -> decltype(f(ptr)); + auto g3() noexcept(noexcept(f(this->ptr))) -> decltype(f((*this).ptr)); + auto g4() const noexcept(noexcept(f(((this))->ptr))) -> decltype(f(this->ptr)); + auto g5() noexcept(noexcept(this->f(ptr))) -> decltype(this->f(ptr)); + auto g6() const noexcept(noexcept(this->f(((this))->ptr))) -> decltype(this->f(ptr)); + auto g7() noexcept(noexcept(this->f(this->ptr))) -> decltype(this->f((*this).ptr)); + auto g8() const noexcept(noexcept(this->f(((this))->ptr))) -> decltype(this->f(this->ptr)); }; void test_C(C<int> ci) { - int *p = 0; int &ir = ci.g1(); float &fr = ci.g2(); + int &ir2 = ci.g3(); + float &fr2 = ci.g4(); + int &ir3 = ci.g5(); + float &fr3 = ci.g6(); + int &ir4 = ci.g7(); + float &fr4 = ci.g8(); static_assert(!noexcept(ci.g1()), "exception-specification failure"); static_assert(noexcept(ci.g2()), "exception-specification failure"); + static_assert(!noexcept(ci.g3()), "exception-specification failure"); + static_assert(noexcept(ci.g4()), "exception-specification failure"); + static_assert(!noexcept(ci.g5()), "exception-specification failure"); + static_assert(noexcept(ci.g6()), "exception-specification failure"); + static_assert(!noexcept(ci.g7()), "exception-specification failure"); + static_assert(noexcept(ci.g8()), "exception-specification failure"); +} + +namespace PR14263 { + template<typename T> struct X { + void f(); + T f() const; + + auto g() -> decltype(this->f()) { return f(); } + auto g() const -> decltype(this->f()) { return f(); } + }; + template struct X<int>; } namespace PR10036 { |