Skip to content

Commit 72e58e0

Browse files
authored
[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
1 parent 49fd2dd commit 72e58e0

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,8 @@ C++23 Feature Support
272272

273273
- Extend lifetime of temporaries in mem-default-init for P2718R0. Clang now fully
274274
supports `P2718R0 Lifetime extension in range-based for loops <https://wg21.link/P2718R0>`_.
275+
276+
- ``__cpp_explicit_this_parameter`` is now defined. (#GH82780)
275277

276278
C++20 Feature Support
277279
^^^^^^^^^^^^^^^^^^^^^

clang/lib/Frontend/InitPreprocessor.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,7 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts,
752752
Builder.defineMacro("__cpp_if_consteval", "202106L");
753753
Builder.defineMacro("__cpp_multidimensional_subscript", "202211L");
754754
Builder.defineMacro("__cpp_auto_cast", "202110L");
755+
Builder.defineMacro("__cpp_explicit_this_parameter", "202110L");
755756
}
756757

757758
// We provide those C++23 features as extensions in earlier language modes, so

clang/test/Lexer/cxx-features.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
#error "wrong value for __cpp_named_character_escapes"
8282
#endif
8383

84-
#if check(explicit_this_parameter, 0, 0, 0, 0, 0, 0, 0)
84+
#if check(explicit_this_parameter, 0, 0, 0, 0, 0, 202110L, 202110L)
8585
#error "wrong value for __cpp_explicit_this_parameter"
8686
#endif
8787

0 commit comments

Comments
 (0)