diff options
Diffstat (limited to 'clang/test/AST/ByteCode/cxx2a.cpp')
-rw-r--r-- | clang/test/AST/ByteCode/cxx2a.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/AST/ByteCode/cxx2a.cpp b/clang/test/AST/ByteCode/cxx2a.cpp index ac2f988..744c99e 100644 --- a/clang/test/AST/ByteCode/cxx2a.cpp +++ b/clang/test/AST/ByteCode/cxx2a.cpp @@ -225,3 +225,17 @@ namespace Dtor { static_assert(pseudo(true, false)); // both-error {{constant expression}} both-note {{in call}} static_assert(pseudo(false, true)); } + +namespace GH150705 { + struct A { }; + struct B : A { }; + struct C : A { + constexpr virtual int foo() const { return 0; } + }; + + constexpr auto p = &C::foo; + constexpr auto q = static_cast<int (A::*)() const>(p); + constexpr B b; + constexpr const A& a = b; + constexpr auto x = (a.*q)(); // both-error {{constant expression}} +} |