Author: Timm Bäder
Date: 2024-06-15T07:46:03+02:00
New Revision: bb3091a6f3fb2b983fc3e0f539ff1d979ea470ac

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

LOG: [clang][Interp][test] Move explicit object parameter test to cxx23.cpp

It needs C++2b.

Added: 
    

Modified: 
    clang/test/AST/Interp/cxx23.cpp
    clang/test/AST/Interp/lambda.cpp

Removed: 
    


################################################################################
diff  --git a/clang/test/AST/Interp/cxx23.cpp b/clang/test/AST/Interp/cxx23.cpp
index d0991f3ffdff5..b36299c3f8aee 100644
--- a/clang/test/AST/Interp/cxx23.cpp
+++ b/clang/test/AST/Interp/cxx23.cpp
@@ -212,3 +212,14 @@ namespace VoidCast {
   static_assert(q == nullptr); // ref-error {{not an integral constant 
expression}} \
                                // ref-note {{initializer of 'q' is not a 
constant expression}}
 }
+
+namespace ExplicitLambdaInstancePointer {
+  struct C {
+      constexpr C(auto) { }
+  };
+  void foo() {
+      constexpr auto b = [](this C) { return 1; }; // all20-error {{explicit 
object parameters are incompatible with C++ standards before C++2b}}
+      constexpr int (*fp)(C) = b;
+      static_assert(fp(1) == 1, "");
+  }
+}

diff  --git a/clang/test/AST/Interp/lambda.cpp 
b/clang/test/AST/Interp/lambda.cpp
index c4fce283ec45a..0eb12643b1b7f 100644
--- a/clang/test/AST/Interp/lambda.cpp
+++ b/clang/test/AST/Interp/lambda.cpp
@@ -280,14 +280,3 @@ namespace InvalidCapture {
     } ();
   }
 }
-
-namespace ExplicitInstancePointer {
-  struct C {
-      constexpr C(auto) { }
-  };
-  void foo() {
-      constexpr auto b = [](this C) { return 1; };
-      constexpr int (*fp)(C) = b;
-      static_assert(fp(1) == 1, "");
-  }
-}


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to