https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104221

Nathaniel Shead <nathanieloshead at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nathanieloshead at gmail dot 
com

--- Comment #1 from Nathaniel Shead <nathanieloshead at gmail dot com> ---
I think this is IFNDR; you cannot have more than one partition with the same
name. See https://eel.is/c++draft/module.unit#3:

> A module partition is a module unit whose module-declaration contains
> a module-partition. A named module shall not contain multiple module
> partitions with the same module-partition. All module partitions of a
> module that are module interface units shall be directly or indirectly
> exported by the primary module interface unit ([module.import]).
> No diagnostic is required for a violation of these rules.

And in particular, unlike a module implementation unit, a module partition does
not implicitly import anything; see https://eel.is/c++draft/module.unit#8 which
says:

> A module-declaration that contains neither an export-keyword nor a
> module-partition implicitly imports the primary module interface unit
> of the module as if by a module-import-declaration.

So this is working as specified. I don't think there'd be any good way of
improving the diagnostics for this either.

Reply via email to