mirror of
https://gcc.gnu.org/git/gcc.git
synced 2026-02-22 03:46:53 -05:00
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: r119634
This commit is contained in:
committed by
Lee Millward
parent
c3d7399cfc
commit
1e23fbbf64
@@ -1,3 +1,9 @@
|
||||
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
|
||||
|
||||
@@ -10238,10 +10238,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);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
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 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/29730
|
||||
|
||||
5
gcc/testsuite/g++.dg/ext/attrib27.C
Normal file
5
gcc/testsuite/g++.dg/ext/attrib27.C
Normal file
@@ -0,0 +1,5 @@
|
||||
//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" }
|
||||
|
||||
Reference in New Issue
Block a user