Commit 623c65f1 by Lee Millward Committed by Lee Millward

re PR c++/28505 (ICE with invalid constructors)

        PR c++/28505
        * decl.c (grokdeclarator): Return early after
        issuing diagnostic about an incomplete type.

        * g++.dg/parse/ctor7.C: New test.
        * g++.dg/parse/ctor8.C: Likewise.

From-SVN: r116302
parent 18ff35c6
......@@ -3,6 +3,10 @@
PR c++/26269
* decl.c (duplicate_decls): Return early if either
newdecl or olddecl is error_mark_node.
PR c++/28505
* decl.c (grokdeclarator): Return early after
issuing diagnostic about an incomplete type.
2006-08-20 Mark Mitchell <mark@codesourcery.com>
......
......@@ -8354,8 +8354,7 @@ grokdeclarator (const cp_declarator *declarator,
error (" in instantiation of template %qT",
current_class_type);
type = error_mark_node;
decl = NULL_TREE;
return error_mark_node;
}
else
{
......
......@@ -2,6 +2,10 @@
PR c++/26269
* g++.dg/other/error14.C: New test.
PR c++/28505
* g++.dg/parse/ctor7.C: New test.
* g++.dg/parse/ctor8.C: Likewise.
2006-08-21 Olivier Hainque <hainque@adacore.com>
//PR c++/28505
struct A
{
A : (); // { dg-error "primary-expression|incomplete type" }
A : (int); // { dg-error "primary-expression|incomplete type|'int'" }
};
struct B
{
char c;
A a;
};
B b = (B){0}; // { dg-error "compound-literals" }
//PR c++/28505
struct A
{
A : (); // { dg-error "primary-expression|incomplete type" }
A : (int); // { dg-error "primary-expression|incomplete type|'int'" }
};
A a = (A){0}; // { dg-error "too many initializers|compound-literals" }
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