[clang] 72e58e0 - [Clang] Set `__cpp_explicit_this_parameter` (#107451)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Dec 18 08:36:51 PST 2024
Author: cor3ntin
Date: 2024-12-18T17:36:47+01:00
New Revision: 72e58e00c27c7f4dd9502c719ddd13dcfef33e85
URL: https://github.com/llvm/llvm-project/commit/72e58e00c27c7f4dd9502c719ddd13dcfef33e85
DIFF: https://github.com/llvm/llvm-project/commit/72e58e00c27c7f4dd9502c719ddd13dcfef33e85.diff
LOG: [Clang] Set `__cpp_explicit_this_parameter` (#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
Added:
Modified:
clang/docs/ReleaseNotes.rst
clang/lib/Frontend/InitPreprocessor.cpp
clang/test/Lexer/cxx-features.cpp
Removed:
################################################################################
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 3645dff2e6fe88..29794f27d30057 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -272,6 +272,8 @@ C++23 Feature Support
- Extend lifetime of temporaries in mem-default-init for P2718R0. Clang now fully
supports `P2718R0 Lifetime extension in range-based for loops <https://wg21.link/P2718R0>`_.
+
+- ``__cpp_explicit_this_parameter`` is now defined. (#GH82780)
C++20 Feature Support
^^^^^^^^^^^^^^^^^^^^^
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index e20feedb840b51..29723b573e771a 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -752,6 +752,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 5b88e00b715080..3a60318d3f2317 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
More information about the cfe-commits
mailing list