Skip to content
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

[class.static.data] IFNDR case is not distinguished #6226

Closed
frederick-vs-ja opened this issue Apr 8, 2023 · 2 comments
Closed

[class.static.data] IFNDR case is not distinguished #6226

frederick-vs-ja opened this issue Apr 8, 2023 · 2 comments

Comments

@frederick-vs-ja
Copy link
Contributor

[class.static.data]/4 currently says:

The member shall still be defined in a namespace scope if it is odr-used ([basic.def.odr]) in the program and the namespace scope definition shall not contain an initializer.

If I understand correctly, no diagnostic is required for the former case (covered by [basic.def.odr]/11), but diagnostic is required for the latter. Should we specify them more differently?

@jensmaurer
Copy link
Member

jensmaurer commented Apr 8, 2023

I'm not seeing an imminent need. The presence of an initializer for a namespace-scope definition is clearly and easily checkable; the ODR violation already has a cross-reference into IFNDR territory.

Is there any implementation that gets this wrong?

@frederick-vs-ja
Copy link
Contributor Author

I'm not seeing an imminent need. The presence of an initializer for a namespace-scope definition is clearly and easily checkable; the ODR violation already has a cross-reference into IFNDR territory.

Agree. Closing since cross-reference is sufficient.

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

2 participants