Skip to content

[cpp.pragma.op] Colocate the two pragma specifications #8100

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

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

Conversation

AlisdairM
Copy link
Contributor

Moves the specification for the _Pragma operator to follow the specification for the pragma directive, to provide clearer context.

@Eisenwave
Copy link
Member

I think there's some logic to what we have right now, which is that _Pragma is last because it's a different type of feature from the usual preprocessing directives.

However, I would be slightly happier if #pragma and _Pragma were next to each other.

@AlisdairM
Copy link
Contributor Author

I did consider whether it was intentional to sparate the operator specification from the directives specification.
I think that predefined macros coming last is not a concern, and maybe an improvement.

The only directive that gets split from the rest is the null directive, so I considered moving that to In order to avoid such splittage, but on balance chose to keep the initial PR minimal. Plus, I had at least two ideas for where the null directive might move: 1) immediately before the pragma directive, so the smallest localized change 2) make it the very first directive, getting the trivial case out of the way before jumping into more detailed features. That also inspired 3) move the error directives to the top too, giving an easy intro to the simplest directives.

All of those changes seemed more appropriate to a follow-up PR, although there was also last option that seemed too heavy handed: 4) operators and directives mix together in earlier subclauses where they are related, so open up a new parent for both the pragma directive and the pragma operator.

My personal choice would be option 3, although I have listed the 4 options in roughly the order I think would br least to most controversial :)

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.

2 participants