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
Conversation
bfece19
to
933995f
Compare
@zygoloid: could you kindly review this? |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 whichitsthat directive occurs#define
(in the translation unit containing the, or otherwise,#define
directive)- if the macro name is not lexically identical to a keyword or to the identifiers
module
orimport
, the first point of macro import in T of atranslationheader unit containing a point of definition for the macro definition, if any.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@tkoeppe, please merge per http://lists.isocpp.org/core/2021/03/10570.php |
Done, thanks! |
Fixes #4404