aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-07-01 07:17:03 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-07-01 07:17:03 +0000
commitc9bdad35171f64bcabad635254fa9f3dfc05a376 (patch)
treef2f9a261b4cf18d6e140bbab31634afdd0b9ef98 /gcc/cp/decl2.c
parent04df67304adf7136ed6aeaf6589755a00c3ac1a2 (diff)
downloadgcc-c9bdad35171f64bcabad635254fa9f3dfc05a376.zip
gcc-c9bdad35171f64bcabad635254fa9f3dfc05a376.tar.gz
gcc-c9bdad35171f64bcabad635254fa9f3dfc05a376.tar.bz2
re PR c++/9559 (ICE with invalid initialization of a static const member)
PR c++/9559 * decl2.c (grokfield): Do not build NOP_EXPRs around the error_mark_node. PR c++/9559 * g++.dg/init/static1.C: New test. From-SVN: r68764
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 9a96000..d27bacd 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -951,12 +951,7 @@ grokfield (tree declarator, tree declspecs, tree init, tree asmspec_tree,
init = decl_constant_value (init);
else if (TREE_CODE (init) == CONSTRUCTOR)
init = digest_init (TREE_TYPE (value), init, (tree *)0);
- if (init == error_mark_node)
- /* We must make this look different than `error_mark_node'
- because `decl_const_value' would mis-interpret it
- as only meaning that this VAR_DECL is defined. */
- init = build1 (NOP_EXPR, TREE_TYPE (value), init);
- else if (! TREE_CONSTANT (init))
+ if (init != error_mark_node && ! TREE_CONSTANT (init))
{
/* We can allow references to things that are effectively
static, since references are initialized with the