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
[module.private.frag] Remove misleading example and broaden note #5537
Conversation
source/modules.tex
Outdated
@@ -827,12 +827,11 @@ | |||
export module A; | |||
export inline void fn_e(); // error: exported inline function \tcode{fn_e} not defined | |||
// before private module fragment | |||
inline void fn_m(); // OK, module-linkage inline function | |||
inline void fn_m(); // error: module-linkage inline function \tcode{fn_m} not defined |
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.
Maybe:
inline void fn_m(); // error: module-linkage inline function \tcode{fn_m} not defined | |
inline void fn_m(); // error: non-exported inline function \tcode{fn_m} not defined | |
// before private module fragment |
The current comment makes it sound like the linkage matters here, and it doesn't; making this parallel the prior comment might make it clearer that exportedness doesn't matter either?
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.
Agreed, fixed.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
@tkoeppe, this seems ready. See also endorsement by @zygoloid here: https://lists.isocpp.org/ext/2022/06/19578.php |
Thanks. Has your later concern been addressed adequately by the response in http://lists.isocpp.org/ext/2022/06/19578.php? |
This PR seems to fix #4890. Confusion is that [dcl.inline] p7 says
Does "that domain" refer to the lexical portion where the inline function or variable is declared or to any same kind of definition domain that can appear in other translation units? Presumably, it means
The comment will be helpful if it is:
Since [dcl.inline] unified apply to all inline functions and variables as long as they are attached to a named module, whether the function is exported or non-exported is not significant here, I think. |
As explained in #5561, "definition domain" is clearly defined lexically ("portion of a translation unit"), so I think there is no remaining issue. Even if there were, it could be addressed separately at a later time. |
(And this only changes a note/example anyway.) |
@zygoloid, this addresses http://lists.isocpp.org/ext/2022/06/19564.php
Note that the example believes that fn_m (module linkage) is ok, but [dcl.inline] p7 makes no distinction between external and module linkage (both fn_e and fn_m are attached to the named module "A", I believe):