aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-03 20:34:35 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-03 20:34:35 +0000
commit62dfea2eac7039147403952b5bd691c36cea4579 (patch)
treeaf602b72b392b74728b687f7532308c6032fa143 /gcc/cp/decl.c
parent038849b39b8a27687b192bbfca220b01c3945591 (diff)
PR c++/37348
* decl.c (cp_finish_decl): Only set DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P if decl is VAR_DECL. * g++.dg/parse/crash45.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139956 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index fbd16e5b19c..c045353fe7f 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -5517,7 +5517,7 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
DECL_INITIAL (decl) = NULL_TREE;
}
- if (init && init_const_expr_p)
+ if (init && init_const_expr_p && TREE_CODE (decl) == VAR_DECL)
{
DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl) = 1;
if (DECL_INTEGRAL_CONSTANT_VAR_P (decl))