Skip to content

[intro.compliance.general], [using.headers] Redundant and inconsistent wording #7846

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
Eisenwave opened this issue Apr 21, 2025 · 1 comment

Comments

@Eisenwave
Copy link
Contributor

[intro.compliance.general] paragraph 5:

A C++ translation unit ([lex.phases]) obtains access to the names defined in the library by including the appropriate standard library header or importing the appropriate standard library named header unit ([using.headers]).

[using.headers] paragraph 1:

The entities in the C++ standard library are defined in headers, whose contents are made available to a translation unit when it contains the appropriate #include preprocessing directive ([cpp.include]) or the appropriate import declaration ([module.import]).

Problems

I think the intent here is that [intro.compliance] acts as a forward reference which lists possible ways to get standard library names, but it fails to mention import std ([std.modules]), so it is incomplete.

It is also weird that [intro.compliance] specifically mentions named header units, but [using.headers], which it references, keeps it somewhat vague with "appropriate import declaration". You would think that the [library] wording would contain more detailed wording, not less detailed.

Suggested solution

If we are keeping the paragraph in [intro.compliance], it should additionally mention [std.modules]. Furthermore,the wording in [using.headers] should mention "named header units" instead of "appropriate import declaration", which is needlessly vague.

@Eisenwave
Copy link
Contributor Author

Another bit of redundancy is [intro.compliance.general] paragraph 6 and [using.linkage], both of which specify that entities in the C++ standard library have external linkage.

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

No branches or pull requests

1 participant