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
This commit is contained in:
parent
04df67304a
commit
c9bdad3517
@ -1,3 +1,9 @@
|
||||
2003-07-01 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/9559
|
||||
* decl2.c (grokfield): Do not build NOP_EXPRs around the
|
||||
error_mark_node.
|
||||
|
||||
2003-06-30 Neil Booth <neil@daikokuya.co.uk>
|
||||
|
||||
* Make-lang.in: Update.
|
||||
|
@ -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
|
||||
|
@ -1,3 +1,8 @@
|
||||
2003-07-01 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/9559
|
||||
* g++.dg/init/static1.C: New test.
|
||||
|
||||
2003-06-30 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||
|
||||
* Changelog: Remove ">>>>>>>" from previous change.
|
||||
|
4
gcc/testsuite/g++.dg/init/static1.C
Normal file
4
gcc/testsuite/g++.dg/init/static1.C
Normal file
@ -0,0 +1,4 @@
|
||||
struct A {
|
||||
static const int size = BOGUS; // { dg-error "" }
|
||||
};
|
||||
const int A::size;
|
Loading…
Reference in New Issue
Block a user