https://github.com/cor3ntin created 
https://github.com/llvm/llvm-project/pull/107451

There are not a lot of outstanding known issues
with deducing this (besides #95112), so it
seems reasonable to claim full support.

Fixes #82780

>From 65a8fbf3f7e0a9ecdd29183ce2a73928b49abde4 Mon Sep 17 00:00:00 2001
From: Corentin Jabot <corentinja...@gmail.com>
Date: Thu, 5 Sep 2024 21:02:24 +0200
Subject: [PATCH] [Clang] Set `__cpp_explicit_this_parameter`

There are not a lot of outstanding known issues
with deducing this (besides #95112), so it
seems reasonable to claim full support.

Fixes #82780
---
 clang/docs/ReleaseNotes.rst             | 1 +
 clang/lib/Frontend/InitPreprocessor.cpp | 1 +
 clang/test/Lexer/cxx-features.cpp       | 2 +-
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index ab3c3e6049f602..d57fef62b4bcfd 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -365,6 +365,7 @@ Bug Fixes to C++ Support
 - Fixed a bug in the substitution of empty pack indexing types. (#GH105903)
 - Clang no longer tries to capture non-odr used default arguments of template 
parameters of generic lambdas (#GH107048)
 - Fixed a bug where defaulted comparison operators would remove ``const`` from 
base classes. (#GH102588)
+- ``__cpp_explicit_this_parameter`` is now defined. (#GH82780)
 
 
 Bug Fixes to AST Handling
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp 
b/clang/lib/Frontend/InitPreprocessor.cpp
index 61260a3379828d..c0460889086d94 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -753,6 +753,7 @@ static void InitializeCPlusPlusFeatureTestMacros(const 
LangOptions &LangOpts,
     Builder.defineMacro("__cpp_if_consteval", "202106L");
     Builder.defineMacro("__cpp_multidimensional_subscript", "202211L");
     Builder.defineMacro("__cpp_auto_cast", "202110L");
+    Builder.defineMacro("__cpp_explicit_this_parameter", "202110L");
   }
 
   // We provide those C++23 features as extensions in earlier language modes, 
so
diff --git a/clang/test/Lexer/cxx-features.cpp 
b/clang/test/Lexer/cxx-features.cpp
index 4a06d29ae9dbc6..34a9d56c581fcd 100644
--- a/clang/test/Lexer/cxx-features.cpp
+++ b/clang/test/Lexer/cxx-features.cpp
@@ -81,7 +81,7 @@
 #error "wrong value for __cpp_named_character_escapes"
 #endif
 
-#if check(explicit_this_parameter, 0, 0, 0, 0, 0, 0, 0)
+#if check(explicit_this_parameter, 0, 0, 0, 0, 0, 202110L, 202110L)
 #error "wrong value for __cpp_explicit_this_parameter"
 #endif
 

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

Reply via email to