Skip to content

Commit ccd3126

Browse files
committed
Merge upstream stable (v2.094.1)
1 parent 0121833 commit ccd3126

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

dmd/dsymbolsem.d

+11
Original file line numberDiff line numberDiff line change
@@ -5971,6 +5971,17 @@ void templateInstanceSemantic(TemplateInstance tempinst, Scope* sc, Expressions*
59715971
{
59725972
tempinst.minst = null;
59735973
}
5974+
// https://issues.dlang.org/show_bug.cgi?id=21299
5975+
// If not speculative, this instance should have the same instantiating
5976+
// root module as its enclosing template symbol. This can differ when
5977+
// the enclosing template gets changed from non-root to a root instance
5978+
// in the instantiation graph. When that occurs, this instance also
5979+
// needs to be appended to the root module, otherwise there will be
5980+
// undefined references at link-time.
5981+
if (tempinst.minst && tempinst.tinst)
5982+
{
5983+
tempinst.minst = tempinst.tinst.minst;
5984+
}
59745985

59755986
tempinst.gagged = (global.gag > 0);
59765987

runtime/druntime

0 commit comments

Comments
 (0)