Created on 2026-08-15.00:00:00 last changed yesterday
Suggested resolution:
Change in 6.8 [basic.memobj] paragraph 10 as follows:
[Note 5:If two declarationscorrespond butof an entity are attached to different modules, the program is ill-formedif one precedes the other (6.4.1 [basic.scope.scope]).—end note][ Example 2:... int g(); // error:-- end example]corresponds tomatches #2, but attached to M ...
Change in 10.1 [module.unit] paragraph 7 as follows:
A module is either a named module or the global module. A declaration is attached to a module as follows:
- If the declaration is a non-dependent friend declaration that nominates a function with a declarator-id that is a qualified-id or template-id or that nominates a class other than with an elaborated-type-specifier with neither a nested-name-specifier nor a simple-template-id, it is attached to the module to which the friend is attached (6.7 [basic.link]).
- Otherwise, if the declaration declares a template specialization (13.7.6 [temp.spec.partial], 13.9.4 [temp.expl.spec]), it is attached to the module to which the primary template is attached.
- Otherwise, if the declaration
it is attached to the global module.
- declares a namespace whose name has external linkage,
- declares a type alias,
- declares a namespace alias, or
- appears within a linkage-specification (9.12 [dcl.link])
- Otherwise, the declaration is attached to the module in whose purview it appears.
(From thread beginning here.)
Issue 3171 was misguided in turning a normative rule about module attachment into a note. The "precedes" condition is implied, though, once template specializations are attached to the module of the primary template.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2026-08-20 15:56:45 | admin | set | messages: + msg8652 |
| 2026-08-15 00:00:00 | admin | create | |