[PR c++/84973] don't defer output of uninstantiated templates
commit977bc3ee11383e76acde2835ab4e2070904cf0bb
authorAlexandre Oliva <aoliva@redhat.com>
Wed, 28 Mar 2018 05:05:14 +0000 (28 05:05 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Wed, 28 Mar 2018 05:05:14 +0000 (28 05:05 +0000)
tree72d8d670b2283dea022de70c80a412d6b390705f
parent04acc378eb62c937576065668df01a23fa1b0680
[PR c++/84973] don't defer output of uninstantiated templates

When an anon struct gets a name through a typedef, we reset its
linkage and that of its members.  Member functions may get vague
linkage, which schedules them for deferred output, but we don't want
to add them to the queue if they're uninstantiated templates,
e.g. because the enclosing function is a template.  They will be added
as needed when the enclosing template is instantiated.

for  gcc/cp/ChangeLog

PR c++/84973
* decl2.c (note_vague_linkage_fn): Don't defer uninstantiated
templates.

for  gcc/testsuite/ChangeLog

PR c++/84973
* g++.dg/template/pr84973.C: New.
* g++.dg/template/pr84973-2.C: New.
* g++.dg/template/pr84973-3.C: New.

From-SVN: r258914
gcc/cp/ChangeLog
gcc/cp/decl2.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/pr84973-2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/pr84973-3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/pr84973.C [new file with mode: 0644]