mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-21 15:41:09 +08: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: r119633
This commit is contained in:
parent
f4ab891606
commit
baa5bf1141
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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 Mike Stump <mrs@apple.com>
|
||||
|
||||
* treelang/compile/var_defs.tree: Adjust.
|
||||
|
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" }
|
||||
|
Loading…
x
Reference in New Issue
Block a user