Commit 16d5ffec by Simon Martin Committed by Simon Martin

re PR c/35437 (ICE with struct containing incomplete type)

gcc/

2008-10-07  Simon Martin  <simartin@users.sourceforge.net>
        
        PR c/35437
        * expr.c (count_type_elements): Handle ERROR_MARK.

gcc/testsuite/

2008-01-07  Simon Martin  <simartin@users.sourceforge.net>

        PR c/35437
        * gcc.dg/struct-parse-2.c: New test.
        * g++.dg/parse/struct-4.C: New test.

From-SVN: r140953
parent 3b14bb39
2008-10-07 Simon Martin <simartin@users.sourceforge.net>
PR c/35437
* expr.c (count_type_elements): Handle ERROR_MARK.
2008-10-07 Jakub Jelinek <jakub@redhat.com> 2008-10-07 Jakub Jelinek <jakub@redhat.com>
PR debug/29609 PR debug/29609
......
...@@ -5021,6 +5021,9 @@ count_type_elements (const_tree type, bool allow_flexarr) ...@@ -5021,6 +5021,9 @@ count_type_elements (const_tree type, bool allow_flexarr)
case REFERENCE_TYPE: case REFERENCE_TYPE:
return 1; return 1;
case ERROR_MARK:
return 0;
case VOID_TYPE: case VOID_TYPE:
case METHOD_TYPE: case METHOD_TYPE:
case FUNCTION_TYPE: case FUNCTION_TYPE:
......
2008-10-07 Simon Martin <simartin@users.sourceforge.net>
PR c/35437
* gcc.dg/struct-parse-2.c: New test.
* g++.dg/parse/struct-4.C: New test.
2008-10-07 Jakub Jelinek <jakub@redhat.com> 2008-10-07 Jakub Jelinek <jakub@redhat.com>
PR debug/29609 PR debug/29609
......
/* PR c/35437 */
/* { dg-do "compile" } */
struct A
{
int i;
struct A a; /* { dg-error "has incomplete type" } */
};
void foo()
{
struct A b = { 0 };
}
/* PR c/35437 */
/* { dg-do "compile" } */
struct A
{
int i;
struct A a; /* { dg-error "has incomplete type" } */
};
void foo()
{
struct A b = { 0 };
}
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