aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/repo.c
diff options
context:
space:
mode:
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 eee3b87f8d3..9c7317b6e97 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;