Skip to content

[namespace.std] Allow rejection of programs when they add declarations to the namespace std#9165

Open
TymianekPL wants to merge 1 commit into
cplusplus:mainfrom
TymianekPL:namespace.std-ub-to-ifndr
Open

[namespace.std] Allow rejection of programs when they add declarations to the namespace std#9165
TymianekPL wants to merge 1 commit into
cplusplus:mainfrom
TymianekPL:namespace.std-ub-to-ifndr

Conversation

@TymianekPL

Copy link
Copy Markdown
Contributor

Changing the behaviour from undefined to ill-formed (no diagnostics required) in [namespace.std] when a program attempts to add a declaration to the namespace std.

…ce std

undefined => ill-formed (no diagnostics required) in [namespace.std]
@jensmaurer jensmaurer added lwg Issue must be reviewed by LWG. not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking. labels Jun 29, 2026
@jensmaurer

Copy link
Copy Markdown
Member

This change is not editorial.

Please file an LWG issue. (I do agree with the change, though.)

@TymianekPL

Copy link
Copy Markdown
Contributor Author

The issue has been filed. I assume I should file another LWG issue to change "declarations or definitions" to "declarations" rather than make a PR?
I already made the commit in a cplusplus/draft fork, so just making sure ^^

@frederick-vs-ja

frederick-vs-ja commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

I think there're many other occurrences of "undefined behavior" in the library wording intend to allow, but not require, implementations to reject compilation. So, "ill-formed, no diagnostic required" should be used instead.

LWG3142 is addressing one such case, although I think we should the make whole [res.on.functions] say IFNDR.

@TymianekPL

Copy link
Copy Markdown
Contributor Author

I filed an LWG yesterday correcting namespace std, posix, future namespaces, reserved items in the standard library and header contents to say ill-formed, no diagnostics required ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lwg Issue must be reviewed by LWG. not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants