re PR c++/10968 (If member function implicitly instantiated, explicit instantiation of class fails to instantiate it)
PR c++/10968 * pt.c (mark_decl_instantiated): Set TREE_SYMBOL_REFERENCED. [[Split portion of a mixed commit.]] From-SVN: r67725.2
This commit is contained in:
parent
aa9b0aca6a
commit
346eeb157e
2 changed files with 9 additions and 0 deletions
|
@ -9974,6 +9974,9 @@ mark_decl_instantiated (result, extern_p)
|
|||
set correctly by tsubst. */
|
||||
TREE_PUBLIC (result) = 1;
|
||||
|
||||
/* This might have been set by an earlier implicit instantiation. */
|
||||
DECL_COMDAT (result) = 0;
|
||||
|
||||
if (! extern_p)
|
||||
{
|
||||
DECL_INTERFACE_KNOWN (result) = 1;
|
||||
|
|
6
gcc/testsuite/g++.dg/template/explicit-instantiation2.C
Normal file
6
gcc/testsuite/g++.dg/template/explicit-instantiation2.C
Normal file
|
@ -0,0 +1,6 @@
|
|||
// Bug 10968: implicit instantiation overrides explicit instantiation
|
||||
// { dg-final { scan-assembler "_Z1fIiET_S0_" } }
|
||||
|
||||
template <class T> T f (T t) { return t; }
|
||||
inline void g () { f (4); }
|
||||
template int f (int);
|
Loading…
Add table
Reference in a new issue