Commit baa5bf11 by Lee Millward Committed by Lee Millward

re PR c++/29980 (ICE using attribute in invalid declaration)

        PR c++/29980
        * cp_parser_elaborated_type_specifier: Check
        the return value of check_elaborated_type_specifier.

        * g++.dg/ext/attrib27.C: New test.
        * g++.dg/parse/struct-as-enum1.C: Adjust error markers.
        * g++.dg/parse/typedef5.C: Likewise.

From-SVN: r119633
parent f4ab8916
2006-12-07 Lee Millward <lee.millward@codesourcery.com>
PR c++/29980
* cp_parser_elaborated_type_specifier: Check
the return value of check_elaborated_type_specifier.
2006-12-06 Mark Mitchell <mark@codesourcery.com>
PR c++/29730
......
......@@ -10311,10 +10311,15 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
}
if (TREE_CODE (TREE_TYPE (decl)) != TYPENAME_TYPE)
check_elaborated_type_specifier
(tag_type, decl,
(parser->num_template_parameter_lists
|| DECL_SELF_REFERENCE_P (decl)));
{
bool allow_template = (parser->num_template_parameter_lists
|| DECL_SELF_REFERENCE_P (decl));
type = check_elaborated_type_specifier (tag_type, decl,
allow_template);
if (type == error_mark_node)
return error_mark_node;
}
type = TREE_TYPE (decl);
}
......
2006-12-07 Lee Millward <lee.millward@codesourcery.com>
PR c++/29980
* g++.dg/ext/attrib27.C: New test.
* g++.dg/parse/struct-as-enum1.C: Adjust error markers.
* g++.dg/parse/typedef5.C: Likewise.
2006-12-07 Mike Stump <mrs@apple.com>
* treelang/compile/var_defs.tree: Adjust.
//PR c++/29980
struct A { typedef int X; }; // { dg-error "previous declaration" }
struct __attribute__((unused)) A::X; // { dg-error "typedef-name" }
......@@ -7,4 +7,4 @@ namespace N
struct A {}; // { dg-error "previous declaration" }
}
typedef enum N::A B; // { dg-error "enum" }
typedef enum N::A B; // { dg-error "enum|invalid type" }
......@@ -3,4 +3,4 @@ namespace A
typedef int T; // { dg-error "previous declaration" }
}
class A::T x; // { dg-error "using typedef-name" }
class A::T x; // { dg-error "using typedef-name|invalid type" }
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