Skip to content

[basic.scope.scope] Update the note about special cases #7594

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

Merged
merged 2 commits into from
Feb 9, 2025

Conversation

Endilll
Copy link
Contributor

@Endilll Endilll commented Jan 28, 2025

[basic.scope.scope] has a lengthy note about declarations that target a different scope than the scope they inhabit. This patch updates a bullet about declarations inhabiting a block scope in accordance with [dcl.meaning]/3.5 to make the note more complete:

If the declaration inhabits a block scope S and declares a function ([dcl.fct]) or uses the extern specifier, the declaration shall not be attached to a named module ([module.unit]); its target scope is the innermost enclosing namespace scope, but the name is bound in S.

@Endilll
Copy link
Contributor Author

Endilll commented Jan 28, 2025

MacOS is failing with

/Library/TeX/texbin/tlmgr: checksum error when downloading /tmp/nUef4otpiw/wzBWoj7dcM from https://us.mirrors.cicku.me/ctan/systems/texlive/tlnet/tlpkg/texlive.tlpdb: digest disagree

I'm not sure this is my fault.

Copy link
Member

@jensmaurer jensmaurer left a comment

Choose a reason for hiding this comment

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

I'm fine with adding the cross-reference.
I don't think notes need to be exhaustive or precise; they just have to be correct.
The existing note seems to be correct; if the missing mention of "function declarations" is the concern, I'm ok adding those: "Block-scope extern or function declarations..."
Other bullets in this note also talk about "larger enclosing scope".

@Endilll
Copy link
Contributor Author

Endilll commented Jan 28, 2025

if the missing mention of "function declarations" is the concern, I'm ok adding those: "Block-scope extern or function declarations..."

Yes, this is the primary concern I have. I applied your suggestion.

Other bullets in this note also talk about "larger enclosing scope".

I see; I reverted the part about innermost namespace scope.

@tkoeppe tkoeppe merged commit dfdc64c into cplusplus:main Feb 9, 2025
2 checks passed
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.

3 participants