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

--- Comment #11 from Thomas Berger <loki at loki dot codes> ---
(In reply to Nathaniel Shead from comment #10)
> Are you maybe looking at a different testcase?  The testcase in comment #1
> only used header units, there are no named modules involved, so everything
> should be OK.  ...ah, I see, in the patch the testcase there used named
> modules instead of header units.  Right, that makes sense then.
That's on me, sorry, sometime during testing i migrated from header to modules,
and forgotten, you are right, that is essentially my testcase, that should
produce an ODR, that is an different issue. 

I will recheck later today with the initial header-units variant.

Sorry for that confusion.

> I agree that if we end up with functions attached to different named modules
> (an adjustment of the testcase where we export different declarations) then
> this is IFNDR.  And probably the most sensible approach in that case would
> be to just continue to consider as them different declarations, so don't do
> any extra attempts at merging.

That is already the logic here. But if i read the standard correctly, a
diagnostic is required in this case "[...]a diagnostic is required only if the
definable item is attached to a named module
and a prior definition is reachable at the point where a later definition
occurs.[...]".

Reply via email to