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

--- Comment #1 from Jason Merrill <jason at gcc dot gnu.org> ---
Reduced:

TU1----
export module api;
export struct S { };
export template <class T> struct A { };
export using a_s = A<S>;

TU2----
export module outer;
import api;
struct Outer {
  a_s mem;
  Outer();
};

TU3----
module outer;
Outer::Outer() {}

The issue is that A<S> is not instantiated in TU1, it is instantiated in TU2
but not written out, so it isn't read into TU3, and so when we try to
initialize mem in the constructor it still has an incomplete type.

We could instantiate in TU3 as well, but I think the right answer is to write
out the instantiation in TU2.

a_s corresponds to std::mt19937_64 in the original testcase.

Reply via email to