Skip to content
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

[2025-02 CWG Motion 8] P2786R13 Trivial Relocation #7705

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AlisdairM
Copy link
Contributor

@AlisdairM AlisdairM commented Feb 19, 2025

Fixes #7658.
Also fixes cplusplus/papers#1463

Added freestanding to the lib feature-test macro, as all new parts are marked as freestanding.

Picked the most appropriate location within the type traits spec for each of the three new traits.

@AlisdairM AlisdairM force-pushed the motions-202502-cwg-8 branch from 5cca302 to c259b6a Compare February 19, 2025 19:32
@AlisdairM AlisdairM changed the title [2025-02 CWG Motion 8] P2786R13 Trivial Relocation] [2025-02 CWG Motion 8] P2786R13 Trivial Relocation Feb 19, 2025
@@ -36,7 +36,7 @@

\begin{bnf}
\nontermdef{class-head}\br
class-key \opt{attribute-specifier-seq} class-head-name \opt{class-virt-specifier} \opt{base-clause}\br
class-key \opt{attribute-specifier-seq} class-head-name \opt{class-property-specifier-seq} \opt{base-clause}\br
Copy link
Contributor Author

@AlisdairM AlisdairM Feb 20, 2025

Choose a reason for hiding this comment

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

It looks like a cleaner fix would be to move the optional class-property-specifier-seq onto the class-head-name production, but that is probably a bigger change than should be considered editorial.

Copy link
Member

Choose a reason for hiding this comment

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

Why would that be a "cleaner fix"? What's the "fix" part here? Why cleaner?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have two productions, but the optional class-property-specifier-seq is valid only after a class-head-name. We could move that optional element into the class-head-name and then the optionality of the class-head-name itself becomes more apparent.

If we move the optional class-property-specifier-seq into the class-head-name, we could even simplify the grammar further by making the class-head-name itself optional, needing only one grammar production and not two to say the same thing.

I have confirmed (to the best of my ability) that there are no other uses of the class-head-name production that would become confused by having this extra optional component suddenly showing up.

Added freestanding to the lib feature-test macro, as all new parts
are marked as freestanding.

Picked the most appropriate location within the type traits spec
for each of the three new traits.
@AlisdairM AlisdairM force-pushed the motions-202502-cwg-8 branch from c259b6a to a672a04 Compare February 24, 2025 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[2025-02 CWG Motion 8] P2786R13 Trivial Relocatability For C++26 P2786 R11 Trivial Relocatability For C++26
2 participants