The problem here is that the ASTImporter adds
the template base class member FieldDecl to
the DeclContext twice. This happens because
we don't construct a LookupPtr for decls
that originate from modules and thus the
ASTImporter never realizes that the FieldDecl
has already been imported. These duplicate
decls then break the assumption of the LayoutBuilder
which expects only a single member decl to
exist.
The test will be fixed by a follow-up revision
and is thus skipped for now.
I was wondering whether you would have the crash if you used the directly the base class? I.e. if you had the ClassInMod3Base<int> VecInMod1 here and ClassInMod3Base<int> VecInMod2 in the other module.