diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-10-23 09:41:11 +0200 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-10-27 11:50:35 +0100 |
commit | e419ede8915eeb879de3d9c026cd4213aaceb86a (patch) | |
tree | 03b7bf22cb46b94e4ad563d88dfbb0e73aaac92e /gcc/fortran/trans-array.c | |
parent | 14e19b82c1e67ead60c3095ac23347317298904b (diff) | |
download | gcc-e419ede8915eeb879de3d9c026cd4213aaceb86a.zip gcc-e419ede8915eeb879de3d9c026cd4213aaceb86a.tar.gz gcc-e419ede8915eeb879de3d9c026cd4213aaceb86a.tar.bz2 |
d: Merge upstream dmd 0fcdaab32
Fixes a bug where there was undefined template references when compiling
upstream dmd mainline.
In `TemplateInstance::semantic`, there exists special handling of
matching template instances for the same template declaration to ensure
that only at most one instance gets codegen'd.
If the primary instance `inst` originated from a non-root module, the
`minst` field will be updated so it is now coming from a root module,
however all Dsymbol `inst->members` of the instance still have their
`_scope->minst` pointing at the original non-root module. We must now
propagate `minst` to all members so that forward referenced dependencies
that get instantiated will also be appended to the root module,
otherwise there will be undefined references at link-time.
This doesn't affect compilations where all modules are compiled
together, as every module is a root module in that situation. What this
primarily affects are cases where there is a mix of root and non-root
modules, and a template was first instantiated in a non-root context,
then later instantiated again in a root context.
Reviewed-on: https://github.com/dlang/dmd/pull/11867
gcc/d/ChangeLog:
* dmd/MERGE: Merge upstream dmd 0fcdaab32
Diffstat (limited to 'gcc/fortran/trans-array.c')
0 files changed, 0 insertions, 0 deletions