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

[cpp.import] Clarify header units as the source of macro definitions. #4406

Merged
merged 1 commit into from Mar 4, 2021

Conversation

jensmaurer
Copy link
Member

Fixes #4404

@tkoeppe
Copy link
Contributor

tkoeppe commented Dec 14, 2020

@zygoloid: could you kindly review this?

Copy link
Member

@zygoloid zygoloid left a comment

Choose a reason for hiding this comment

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

I think this is correct and an improvement. Some possible further improvements suggested but I don't think they're essential.

denoted by the \grammarterm{header-name}.
denoted by the \grammarterm{header-name},
as described below.
\end{note}
\indextext{point of!macro import|see{macro, point of import}}%
The \defnx{point of macro import}{macro!point of import} for the
first two forms of \grammarterm{pp-import} is
Copy link
Member

Choose a reason for hiding this comment

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

For completeness, should we say "The last form of pp-import is only considered if the first two forms did not match, and does not have a point of macro import." below?

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

of macro import of a header unit containing a point of definition for the
macro definition, if any.
In the latter case, the macro is said
to be \defnx{imported}{macro!import} from the header unit.
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we can make this a little clearer by separating the two cases with bullets and moving the parenthesized text to the front:

The point of definition of a macro definition within a translation unit T is:

  • if the #define directive of the macro definition occurs within T, the point at which its #define that directive occurs (in the translation unit containing the #define directive), or otherwise,
  • if the macro name is not lexically identical to a keyword or to the identifiers module or import, the first point of macro import in T of a translation header unit containing a point of definition for the macro definition, if any.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@tkoeppe tkoeppe added the changes requested Changes to the wording or approach have been requested and not yet applied. label Dec 15, 2020
@jensmaurer jensmaurer removed the changes requested Changes to the wording or approach have been requested and not yet applied. label Dec 18, 2020
@jensmaurer
Copy link
Member Author

@tkoeppe tkoeppe merged commit 066bb6b into cplusplus:master Mar 4, 2021
@tkoeppe
Copy link
Contributor

tkoeppe commented Mar 4, 2021

Done, thanks!

@jensmaurer jensmaurer deleted the c16 branch March 4, 2021 20:58
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.

[cpp.import] Use "header unit" where appropriate
3 participants