diff options
Diffstat (limited to 'clang/test/AST/ByteCode')
| -rw-r--r-- | clang/test/AST/ByteCode/cxx20.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/AST/ByteCode/cxx20.cpp b/clang/test/AST/ByteCode/cxx20.cpp index 1888998..cb788fa 100644 --- a/clang/test/AST/ByteCode/cxx20.cpp +++ b/clang/test/AST/ByteCode/cxx20.cpp @@ -1183,3 +1183,21 @@ namespace VirtualFunctionCallThroughArrayElem { static_assert(a[2][3].foo()); // both-error {{not an integral constant expression}} \ // both-note {{virtual function called on object 'a[2][3]' whose dynamic type is not constant}} } + +namespace NonPureVirtualCall { + struct A { + constexpr virtual void call(int) = 0; + constexpr void call2() { call(0); } + }; + + struct B : A { + constexpr void call(int) override {} + }; + + consteval void check() { + B b; + b.call2(); + } + + int main() { check(); } +} |
