Commit cc011e7f by Lee Millward Committed by Lee Millward

re PR c++/28347 (ICE on typedef with initialization)

        PR c++/28347
        * decl.c (start_decl): Return error_mark_node if a 
        diagnostic was issed for an invalid typedef initialization.

        * g++.dg/ext/typedef-init.C: Add new test for 
        typedef initialization inside templates. Adjust
        existing error markers

From-SVN: r115931
parent 71156bcc
2006-08-03 Lee Millward <lee.millward@codesourcery.com>
PR c++/28347
* decl.c (start_decl): Return error_mark_node if a
diagnostic was issed for an invalid typedef initialization.
2006-08-03 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 2006-08-03 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/27508 PR c++/27508
......
...@@ -3860,8 +3860,7 @@ start_decl (const cp_declarator *declarator, ...@@ -3860,8 +3860,7 @@ start_decl (const cp_declarator *declarator,
{ {
case TYPE_DECL: case TYPE_DECL:
error ("typedef %qD is initialized (use __typeof__ instead)", decl); error ("typedef %qD is initialized (use __typeof__ instead)", decl);
initialized = 0; return error_mark_node;
break;
case FUNCTION_DECL: case FUNCTION_DECL:
error ("function %q#D is initialized like a variable", decl); error ("function %q#D is initialized like a variable", decl);
......
2006-08-03 Lee Millward <lee.millward@codesourcery.com>
PR c++/28347
* g++.dg/ext/typedef-init.C: Add new test for typedef
initialization inside templates. Adjust existing
error markers.
2006-08-03 Mark Mitchell <mark@codesourcery.com> 2006-08-03 Mark Mitchell <mark@codesourcery.com>
PR c++/28148 PR c++/28148
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
typedef A = 0; /* { dg-error "initialized" "A" } */ typedef A = 0; /* { dg-error "initialized" "A" } */
/* { dg-warning "no type" "A warns" { target *-*-* } 14 } */ /* { dg-warning "no type" "A warns" { target *-*-* } 14 } */
A a; /* { dg-bogus "" "A error cascade" } */ A a; /* { dg-error "does not name a type" "A error cascade" } */
/* Case B: with a type also. */ /* Case B: with a type also. */
typedef int B = 0; /* { dg-error "initialized" "B" } */ typedef int B = 0; /* { dg-error "initialized" "B" } */
B b; /* { dg-bogus "" "B error cascade" } */ B b; /* { dg-error "does not name a type" "B error cascade" } */
/* C and D are the same as A and B, but wrapped in a structure; /* C and D are the same as A and B, but wrapped in a structure;
field declarations go by a different code path in C++ (ick). */ field declarations go by a different code path in C++ (ick). */
...@@ -31,3 +31,8 @@ struct S { ...@@ -31,3 +31,8 @@ struct S {
typedef int D = 0; /* { dg-error "initialized" "D" } */ typedef int D = 0; /* { dg-error "initialized" "D" } */
D d; /* { dg-bogus "" "D error cascade" } */ D d; /* { dg-bogus "" "D error cascade" } */
}; };
template<int> void foo()
{
typedef int i = 0; /* { dg-error "is initialized" } */
}
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