diff options
| author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-06-10 19:08:46 +0000 |
|---|---|---|
| committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-06-10 19:08:46 +0000 |
| commit | 4e80f1c403142b0e45121fd16bf76144f9fc2200 (patch) | |
| tree | 306a52da0be421e4dbaa69c117308f122425abab | |
| parent | ef076dae5f6c0052a3d0ee93c4fa65b293a7b315 (diff) | |
| download | ppe42-gcc-4e80f1c403142b0e45121fd16bf76144f9fc2200.tar.gz ppe42-gcc-4e80f1c403142b0e45121fd16bf76144f9fc2200.zip | |
PR c++/10968
* pt.c (mark_decl_instantiated): Set TREE_SYMBOL_REFERENCED.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@67725 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/cp/pt.c | 3 | ||||
| -rw-r--r-- | gcc/testsuite/g++.dg/template/explicit-instantiation2.C | 6 |
2 files changed, 9 insertions, 0 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 1f64f747ca6..926b26d5c55 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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; diff --git a/gcc/testsuite/g++.dg/template/explicit-instantiation2.C b/gcc/testsuite/g++.dg/template/explicit-instantiation2.C new file mode 100644 index 00000000000..21109a765aa --- /dev/null +++ b/gcc/testsuite/g++.dg/template/explicit-instantiation2.C @@ -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); |

