aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2006-07-16 22:17:20 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2006-07-16 22:17:20 +0200
commit42ccbf3d11f315dc0752c58efb572451a27f82ce (patch)
treea8edcb458cc8e6dc5ef694bad053a8ec1a2f1e6c /gcc/cp/decl2.c
parent22d67c60fa3b3fec0891c03693dbdd86f8389815 (diff)
downloadgcc-42ccbf3d11f315dc0752c58efb572451a27f82ce.zip
gcc-42ccbf3d11f315dc0752c58efb572451a27f82ce.tar.gz
gcc-42ccbf3d11f315dc0752c58efb572451a27f82ce.tar.bz2
re PR c++/28370 (undefined reference to template class static variable in an anonymous namespace)
PR c++/28370 * decl2.c (note_vague_linkage_var): Removed. (finish_static_data_member_decl): Add decl to pending_statics vector directly. Do it even for non-public decls. * g++.dg/template/anon3.C: New test. From-SVN: r115503
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index f1a8a77..dfb30f2 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -700,14 +700,6 @@ note_vague_linkage_fn (tree decl)
}
}
-/* Like note_vague_linkage_fn but for variables. */
-
-static void
-note_vague_linkage_var (tree var)
-{
- VEC_safe_push (tree, gc, pending_statics, var);
-}
-
/* We have just processed the DECL, which is a static data member.
The other parameters are as for cp_finish_decl. */
@@ -723,8 +715,8 @@ finish_static_data_member_decl (tree decl,
TREE_CHAIN of our decl. Instead, we modify cp_finish_decl to do
the right thing, namely, to put this decl out straight away. */
- if (! processing_template_decl && TREE_PUBLIC (decl))
- note_vague_linkage_var (decl);
+ if (! processing_template_decl)
+ VEC_safe_push (tree, gc, pending_statics, decl);
if (LOCAL_CLASS_P (current_class_type))
pedwarn ("local class %q#T shall not have static data member %q#D",