llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Timm Baeder (tbaederr)

<details>
<summary>Changes</summary>

Don't pass a combination of `-std=c++26` and `-fcxx-exceptions` to tests and 
then try to use `throw` as an invalid statement. C++26 actually has working 
exceptions at compile time, even if that is currently not implemented.

---
Full diff: https://github.com/llvm/llvm-project/pull/181150.diff


2 Files Affected:

- (modified) clang/test/AST/ByteCode/cxx26.cpp (+3-3) 
- (modified) clang/test/AST/ByteCode/placement-new.cpp (+3-3) 


``````````diff
diff --git a/clang/test/AST/ByteCode/cxx26.cpp 
b/clang/test/AST/ByteCode/cxx26.cpp
index acab347963923..8035a2640ff5f 100644
--- a/clang/test/AST/ByteCode/cxx26.cpp
+++ b/clang/test/AST/ByteCode/cxx26.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -std=c++26 -fsyntax-only -fcxx-exceptions -verify=ref,both 
%s
-// RUN: %clang_cc1 -std=c++26 -fsyntax-only -fcxx-exceptions 
-verify=expected,both %s -fexperimental-new-constant-interpreter
+// RUN: %clang_cc1 -std=c++26 -fsyntax-only -verify=ref,both      %s
+// RUN: %clang_cc1 -std=c++26 -fsyntax-only -verify=expected,both %s 
-fexperimental-new-constant-interpreter
 
 namespace std {
   using size_t = decltype(sizeof(0));
@@ -49,7 +49,7 @@ static_assert(*f == 12);
 namespace ExplicitThisInBacktrace {
   struct S {
     constexpr void foo(this const S& self) {
-      throw; // both-note {{not valid in a constant expression}}
+      __builtin_abort(); // both-note {{not valid in a constant expression}}
     }
   };
 
diff --git a/clang/test/AST/ByteCode/placement-new.cpp 
b/clang/test/AST/ByteCode/placement-new.cpp
index 503e456565f5d..2c302ef7a8e7b 100644
--- a/clang/test/AST/ByteCode/placement-new.cpp
+++ b/clang/test/AST/ByteCode/placement-new.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -std=c++2c -fcxx-exceptions 
-fexperimental-new-constant-interpreter -verify=expected,both %s -DBYTECODE
-// RUN: %clang_cc1 -std=c++2c -fcxx-exceptions -verify=ref,both %s
+// RUN: %clang_cc1 -std=c++2c -fexperimental-new-constant-interpreter 
-verify=expected,both %s -DBYTECODE
+// RUN: %clang_cc1 -std=c++2c                                         
-verify=ref,both %s
 
 typedef __INT64_TYPE__ int64_t;
 namespace std {
@@ -239,7 +239,7 @@ namespace records {
   /// Destructor is NOT called.
   struct A {
     bool b;
-    constexpr ~A() { if (b) throw; }
+    constexpr ~A() { if (b) __builtin_abort(); }
   };
 
   constexpr int foo() {

``````````

</details>


https://github.com/llvm/llvm-project/pull/181150
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to