Commit 0a880880 by Joseph Myers Committed by Joseph Myers

c-typeck.c (output_init_element): Return early if value is error_mark_node.

	* c-typeck.c (output_init_element): Return early if value is
	error_mark_node.

testsuite:
	* gcc.dg/init-undef-1.c: New test.

From-SVN: r90146
parent ddd8e3ca
2004-11-05 Joseph S. Myers <joseph@codesourcery.com>
* c-typeck.c (output_init_element): Return early if value is
error_mark_node.
2004-11-05 James E Wilson <wilson@specifixinc.com> 2004-11-05 James E Wilson <wilson@specifixinc.com>
* invoke.texi (-fno-guess-branch-probability): Rewrite. * invoke.texi (-fno-guess-branch-probability): Rewrite.
......
...@@ -5667,7 +5667,7 @@ static void ...@@ -5667,7 +5667,7 @@ static void
output_init_element (tree value, bool strict_string, tree type, tree field, output_init_element (tree value, bool strict_string, tree type, tree field,
int pending) int pending)
{ {
if (type == error_mark_node) if (type == error_mark_node || value == error_mark_node)
{ {
constructor_erroneous = 1; constructor_erroneous = 1;
return; return;
......
2004-11-05 Joseph S. Myers <joseph@codesourcery.com> 2004-11-05 Joseph S. Myers <joseph@codesourcery.com>
* gcc.dg/init-undef-1.c: New test.
2004-11-05 Joseph S. Myers <joseph@codesourcery.com>
* gcc.dg/20040910-1.c, gcc.dg/cpp/digraph2.c, * gcc.dg/20040910-1.c, gcc.dg/cpp/digraph2.c,
gcc.dg/cpp/direct2.c, gcc.dg/cpp/direct2s.c, gcc.dg/cpp/direct2.c, gcc.dg/cpp/direct2s.c,
gcc.dg/cpp/separate-1.c, gcc.dg/noncompile/951123-1.c, gcc.dg/cpp/separate-1.c, gcc.dg/noncompile/951123-1.c,
......
/* Invalid initializers should not receive an "is not constant"
error. */
/* Origin: Joseph Myers <joseph@codesourcery.com> */
/* { dg-do compile } */
/* { dg-options "" } */
int p = c; /* { dg-error "undeclared" } */
struct s { int a; } x = { b }; /* { dg-error "undeclared" } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment