Skip to content

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

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

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 ^^

@tkoeppe

tkoeppe commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Thanks! If this is tracked as an LWG issue, let's close this (editorial) issue then, since indeed the proposed change is not editorial.

@tkoeppe tkoeppe closed this Jul 16, 2026
@TymianekPL

Copy link
Copy Markdown
Contributor Author

Thanks! If this is tracked as an LWG issue, let's close this (editorial) issue then, since indeed the proposed change is not editorial.

My LWG issue was closed as NAD
I'm working on a bigger proposal about this and many other issues related to LWG use of "undefined behaviour" and such because I certainly do not agree nor have the will to fight in e-mail about it ^^

Thank you 💖

@jwakely

jwakely commented Jul 28, 2026

Copy link
Copy Markdown
Member

To be precise, no issue was opened, because the description of the issue was incorrect and the proposed resolution made no normative change.

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.

5 participants