aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2005-06-02 09:09:48 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2005-06-02 09:09:48 +0000
commit58fb06b4a11160c4c6191b6c89f3c1b3a3bd0787 (patch)
tree3bef40413e1c02198cbe7dcb8919b06a068781fb /gcc/cp/decl.c
parentccb4e87e83e9f1e21ba9c79ce21f2d31dcf16a51 (diff)
downloadgcc-58fb06b4a11160c4c6191b6c89f3c1b3a3bd0787.zip
gcc-58fb06b4a11160c4c6191b6c89f3c1b3a3bd0787.tar.gz
gcc-58fb06b4a11160c4c6191b6c89f3c1b3a3bd0787.tar.bz2
re PR c++/20350 (extern template and struct initializer and specification for a static variable)
cp: PR c++/20350 * decl.c (duplicate_decls): Copy all of DECL_USE_TEMPLATE. testsuite: PR c++/20350 * g++.dg/template/spec24.C: New. From-SVN: r100486
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 7f919d5..83bd6fc 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -1672,13 +1672,14 @@ duplicate_decls (tree newdecl, tree olddecl)
DECL_COMDAT (newdecl) |= DECL_COMDAT (olddecl);
DECL_TEMPLATE_INSTANTIATED (newdecl)
|= DECL_TEMPLATE_INSTANTIATED (olddecl);
- /* If the OLDDECL is an implicit instantiation, then the NEWDECL
- must be too. But, it may not yet be marked as such if the
- caller has created NEWDECL, but has not yet figured out that
- it is a redeclaration. */
- if (DECL_IMPLICIT_INSTANTIATION (olddecl)
- && !DECL_USE_TEMPLATE (newdecl))
- SET_DECL_IMPLICIT_INSTANTIATION (newdecl);
+
+ /* If the OLDDECL is an instantiation and/or specialization,
+ then the NEWDECL must be too. But, it may not yet be marked
+ as such if the caller has created NEWDECL, but has not yet
+ figured out that it is a redeclaration. */
+ if (!DECL_USE_TEMPLATE (newdecl))
+ DECL_USE_TEMPLATE (newdecl) = DECL_USE_TEMPLATE (olddecl);
+
/* Don't really know how much of the language-specific
values we should copy from old to new. */
DECL_IN_AGGR_P (newdecl) = DECL_IN_AGGR_P (olddecl);