aboutsummaryrefslogtreecommitdiff
path: root/clang/test/AST
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/AST')
-rw-r--r--clang/test/AST/ByteCode/builtin-functions.cpp3
-rw-r--r--clang/test/AST/ByteCode/cxx20.cpp18
2 files changed, 20 insertions, 1 deletions
diff --git a/clang/test/AST/ByteCode/builtin-functions.cpp b/clang/test/AST/ByteCode/builtin-functions.cpp
index e9093b2..a90f636 100644
--- a/clang/test/AST/ByteCode/builtin-functions.cpp
+++ b/clang/test/AST/ByteCode/builtin-functions.cpp
@@ -1856,7 +1856,8 @@ namespace InitParam {
#endif
-namespace SAddOverflowInt {
+namespace NonBlockPointerStore {
int a;
void foo(void) { a *= __builtin_sadd_overflow(1, 2, 0); }
+ void foo2(void) { a *= __builtin_addc(1, 2, 0, 0); }
}
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(); }
+}