Skip to content

[Clang] Set __cpp_explicit_this_parameter #107451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a nit, "is now defined to the value specified in the C++X specification."

perhaps?


C++20 Feature Support
^^^^^^^^^^^^^^^^^^^^^
Expand Down
1 change: 1 addition & 0 deletions clang/lib/Frontend/InitPreprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Lexer/cxx-features.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading