[clang] 93869df - [clang][Interp][NFC] Simplify a test case

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 9 00:23:58 PDT 2024


Author: Timm Bäder
Date: 2024-07-09T09:23:14+02:00
New Revision: 93869dfd89387844bf8b605ebcd1abc0cc81bde8

URL: https://github.com/llvm/llvm-project/commit/93869dfd89387844bf8b605ebcd1abc0cc81bde8
DIFF: https://github.com/llvm/llvm-project/commit/93869dfd89387844bf8b605ebcd1abc0cc81bde8.diff

LOG: [clang][Interp][NFC] Simplify a test case

Added: 
    

Modified: 
    clang/test/AST/Interp/lifetimes.cpp

Removed: 
    


################################################################################
diff  --git a/clang/test/AST/Interp/lifetimes.cpp b/clang/test/AST/Interp/lifetimes.cpp
index c1046e5689207..c544baba6178c 100644
--- a/clang/test/AST/Interp/lifetimes.cpp
+++ b/clang/test/AST/Interp/lifetimes.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fexperimental-new-constant-interpreter -verify %s
-// RUN: %clang_cc1 -verify=ref %s
+// RUN: %clang_cc1 -fexperimental-new-constant-interpreter -verify=expected,both %s
+// RUN: %clang_cc1 -verify=ref,both %s
 
 struct Foo {
   int a;
@@ -16,9 +16,7 @@ constexpr int dead1() { // expected-error {{never produces a constant expression
   return F2->a; // expected-note 2{{read of variable whose lifetime has ended}} \
                 // ref-note {{read of object outside its lifetime is not allowed in a constant expression}}
 }
-static_assert(dead1() == 1, ""); // expected-error {{not an integral constant expression}} \
-                                 // expected-note {{in call to}} \
-                                 // ref-error {{not an integral constant expression}} \
-                                 // ref-note {{in call to}} \
+static_assert(dead1() == 1, ""); // both-error {{not an integral constant expression}} \
+                                 // both-note {{in call to}}
 
 


        


More information about the cfe-commits mailing list