https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122908
--- Comment #8 from Nathaniel Shead <nshead at gcc dot gnu.org> ---
Just a final hopefully clarifying note:
(In reply to Bernardo Negri from comment #5)
> Even if we assume friendFn<int> or Class<int> (the instantiations) are
> exposures (and apparently GCC thinks friendFn<int> is an exposure)
To be clear, the only function considered an exposure here is the function
named in the error. (All functions we think are exposures are reported, except
those that are also considered TU-local; e.g., the following scenario is OK:
export module M;
static int foo() { return 123; }
static inline int bar() { return foo(); }
here 'bar' is an exposure of 'foo', but is also TU-local, so there are no
issues here. But this is why the diagnostic suggestion of pointing to the
friend function as the "at fault" declaration that exposed the error would be
so tricky to implement.)
Thanks for your time and your bug report, it's greatly appreciated. Let me
know if there's anything else I can try and clarify.