diff --git a/compiler/src/dmd/dsymbolsem.d b/compiler/src/dmd/dsymbolsem.d index ec73e08858e..06eae929abc 100644 --- a/compiler/src/dmd/dsymbolsem.d +++ b/compiler/src/dmd/dsymbolsem.d @@ -4715,6 +4715,15 @@ void templateInstanceSemantic(TemplateInstance tempinst, Scope* sc, ArgumentList visit(cast(Dsymbol)sds); } + override void visit(StructDeclaration sd) + { + // need to visit auto-generated methods as well + if (sd.xeq) visit(sd.xeq); + if (sd.xcmp) visit(sd.xcmp); + if (sd.xhash) visit(sd.xhash); + visit(cast(ScopeDsymbol)sd); + } + override void visit(AttribDeclaration ad) { ad.include(null).foreachDsymbol( s => s.accept(this) ); diff --git a/compiler/test/compilable/issue24830.sh b/compiler/test/compilable/issue24830.sh new file mode 100755 index 00000000000..26864c24493 --- /dev/null +++ b/compiler/test/compilable/issue24830.sh @@ -0,0 +1,34 @@ +#! /usr/bin/env bash + +TEST_DIR=${OUTPUT_BASE} +# create two modules each depending on each other. +# They both do the same template instantiation. +D_FILE1=$TEST_DIR/first.d +D_FILE2=$TEST_DIR/second.d +D_OBJ1=$TEST_DIR/first${OBJ} +D_OBJ2=$TEST_DIR/second${OBJ} +APP=$TEST_DIR/app + +mkdir -p $TEST_DIR + +cat >$D_FILE1 <$D_FILE2 <