[clang] 00c622e - [clang][Interp][Test] Add test for #97302

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 5 03:44:48 PDT 2024


Author: Timm Bäder
Date: 2024-07-05T12:44:32+02:00
New Revision: 00c622e596f918d9d83674b58097c8982ae1af95

URL: https://github.com/llvm/llvm-project/commit/00c622e596f918d9d83674b58097c8982ae1af95
DIFF: https://github.com/llvm/llvm-project/commit/00c622e596f918d9d83674b58097c8982ae1af95.diff

LOG: [clang][Interp][Test] Add test for #97302

Fixes #97302

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/test/AST/Interp/records.cpp b/clang/test/AST/Interp/records.cpp
index 1554e54275598a..f27c895e899486 100644
--- a/clang/test/AST/Interp/records.cpp
+++ b/clang/test/AST/Interp/records.cpp
@@ -494,6 +494,12 @@ namespace DeclRefs {
   constexpr B b;
   static_assert(b.a.m == 100, "");
   static_assert(b.a.f == 100, "");
+
+  constexpr B b2;
+  static_assert(b2.a.m == 100, "");
+  static_assert(b2.a.f == 100, "");
+  static_assert(b2.a.f == 101, ""); // both-error {{failed}} \
+                                    // both-note {{evaluates to '100 == 101'}}
 }
 
 namespace PointerArith {


        


More information about the cfe-commits mailing list