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

--- Comment #4 from Nathaniel Shead <nshead at gcc dot gnu.org> ---
(In reply to Frank B. Brokken from comment #3)
> Hi Nathaniel
> 
> You replied in your 2024-01-04 05:03:10 UTC posting:
> 
> > I think this is IFNDR; you cannot have more than one partition with the same
> > name. 
> 
> Maybe I overlook something, but AFAICS it's not about defining more than one
> partition with the same name. The point of my report is that -at least to
> me- it's peculiar that a partition defining a class apparently requires all
> member functions of that class to be defined in the partition's module file.
>
> If that's really required then that can easily result in source files
> containing the implementations of many member functions, complicating
> maintenance. 


Maybe I'm misunderstanding your situation, but it looks to me that both
'partition.cc' and 'value.cc' attempt to define a partition module named
"mod:partition" (the former as an interface partition, the latter not).

Note that an implementation unit for a module partition file should look like:

  module mod;
  import :partition;
  // provide definitions here

That is, (somewhat confusingly) a module partition always provides a module
interface that can be imported, whether marked 'export' or not.  The presence
of the 'export' keyword just indicates that the partition will be exported from
the primary module interface unit and its contents will be visible to importers
from other modules.

Hopefully this clarifies the situation somewhat, feel free to let me know if
you have any other questions (and thanks for the report regardless!).

Reply via email to