summaryrefslogtreecommitdiff
path: root/gcc/cp/repo.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2006-01-04 01:04:51 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2006-01-04 01:04:51 +0000
commitb3cee19984bb007465ff58ed42c37cafc45c6219 (patch)
tree777031142703d177a212c16367bd180fc4f36a18 /gcc/cp/repo.c
parent165178fb0a08625f9df3deb2ecb9be978ea52c1f (diff)
downloadgcc-b3cee19984bb007465ff58ed42c37cafc45c6219.tar.gz
PR c++/25492
* name-lookup.c (push_class_level_binding): When a derived class provides a type binding, eliminate any type binding from a base class. PR c++/25625 * repo.c (repo_emit_p): Always instantiate static data members initialized by constant expressions, so that there values are available. PR c++/25492 * g++.dg/lookup/friend9.C: New test. PR c++/25625 * g++.dg/template/repo5.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109307 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/repo.c')
-rw-r--r--gcc/cp/repo.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cp/repo.c b/gcc/cp/repo.c
index d2fae3e0a17..ad01010c363 100644
--- a/gcc/cp/repo.c
+++ b/gcc/cp/repo.c
@@ -298,6 +298,12 @@ repo_emit_p (tree decl)
&& (!TYPE_LANG_SPECIFIC (type)
|| !CLASSTYPE_TEMPLATE_INSTANTIATION (type)))
return 2;
+ /* Static data members initialized by constant expressions must
+ be processed where needed so that their definitions are
+ available. */
+ if (DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl)
+ && DECL_CLASS_SCOPE_P (decl))
+ return 2;
}
else if (!DECL_TEMPLATE_INSTANTIATION (decl))
return 2;