re PR c++/18123 (ICE on templated enum)
PR c++/18123 * parser.c (cp_parser_type_specifier): Catch template declaration of enum. * g++.dg/parse/enum2.C: New test. * g++.old-deja/g++.pt/enum5.C: Adjust error location. From-SVN: r91630
This commit is contained in:
parent
1a06672a3b
commit
a5e515185a
@ -1,3 +1,9 @@
|
|||||||
|
2004-12-02 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
||||||
|
|
||||||
|
PR c++/18123
|
||||||
|
* parser.c (cp_parser_type_specifier): Catch template declaration
|
||||||
|
of enum.
|
||||||
|
|
||||||
2004-12-01 Matt Austern <austern@apple.com>
|
2004-12-01 Matt Austern <austern@apple.com>
|
||||||
|
|
||||||
* name-lookup.c (namespace_binding): Omit alias check for global namespace.
|
* name-lookup.c (namespace_binding): Omit alias check for global namespace.
|
||||||
|
@ -9130,7 +9130,15 @@ cp_parser_type_specifier (cp_parser* parser,
|
|||||||
&& cp_lexer_peek_nth_token (parser->lexer, 3)->type
|
&& cp_lexer_peek_nth_token (parser->lexer, 3)->type
|
||||||
== CPP_OPEN_BRACE))
|
== CPP_OPEN_BRACE))
|
||||||
{
|
{
|
||||||
type_spec = cp_parser_enum_specifier (parser);
|
if (parser->num_template_parameter_lists)
|
||||||
|
{
|
||||||
|
error ("template declaration of %qs", "enum");
|
||||||
|
cp_parser_skip_to_end_of_block_or_statement (parser);
|
||||||
|
type_spec = error_mark_node;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
type_spec = cp_parser_enum_specifier (parser);
|
||||||
|
|
||||||
if (declares_class_or_enum)
|
if (declares_class_or_enum)
|
||||||
*declares_class_or_enum = 2;
|
*declares_class_or_enum = 2;
|
||||||
if (decl_specs)
|
if (decl_specs)
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
2004-12-02 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
||||||
|
|
||||||
|
PR c++/18123
|
||||||
|
* g++.dg/parse/enum2.C: New test.
|
||||||
|
* g++.old-deja/g++.pt/enum5.C: Adjust error location.
|
||||||
|
|
||||||
2004-12-02 Nick Clifton <nickc@redhat.com>
|
2004-12-02 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
* gcc.target/xstormy16: New test directory.
|
* gcc.target/xstormy16: New test directory.
|
||||||
|
7
gcc/testsuite/g++.dg/parse/enum2.C
Normal file
7
gcc/testsuite/g++.dg/parse/enum2.C
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
// { dg-do compile }
|
||||||
|
|
||||||
|
// Origin: Volker Reichelt <reichelt@gcc.gnu.org>
|
||||||
|
|
||||||
|
// PR c++/18123: ICE pushing tag from invalid template.
|
||||||
|
|
||||||
|
template<int> enum E { e }; // { dg-error "template declaration" }
|
@ -1,4 +1,4 @@
|
|||||||
// { dg-do assemble }
|
// { dg-do assemble }
|
||||||
|
|
||||||
template <>
|
template <> // { dg-error "" } template declaration of enum
|
||||||
enum E {e}; // { dg-error "" } template declaration of enum
|
enum E {e};
|
||||||
|
Loading…
Reference in New Issue
Block a user