re PR c++/38637 (ICE with template declaration of enum)
PR c++/38637 * decl.c (start_enum): If enumtype is error_mark_node, exit early. * g++.dg/cpp0x/enum2.C: New test. From-SVN: r142946
This commit is contained in:
parent
bbddfe5b6c
commit
19bb3aa5c5
4 changed files with 18 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
2008-12-29 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/38637
|
||||
* decl.c (start_enum): If enumtype is error_mark_node, exit early.
|
||||
|
||||
2008-12-28 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/38650
|
||||
|
|
|
@ -10891,6 +10891,9 @@ start_enum (tree name, tree underlying_type, bool scoped_enum_p)
|
|||
enumtype = pushtag (name, enumtype, /*tag_scope=*/ts_current);
|
||||
}
|
||||
|
||||
if (enumtype == error_mark_node)
|
||||
return enumtype;
|
||||
|
||||
if (scoped_enum_p)
|
||||
{
|
||||
SET_SCOPED_ENUM_P (enumtype, 1);
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2008-12-29 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/38637
|
||||
* g++.dg/cpp0x/enum2.C: New test.
|
||||
|
||||
2008-12-28 Andrew Pinski <pinskia@gmail.com>
|
||||
|
||||
PR libobjc/36610
|
||||
|
|
5
gcc/testsuite/g++.dg/cpp0x/enum2.C
Normal file
5
gcc/testsuite/g++.dg/cpp0x/enum2.C
Normal file
|
@ -0,0 +1,5 @@
|
|||
// PR c++/38637
|
||||
// { dg-do compile }
|
||||
// { dg-options "-std=c++0x" }
|
||||
|
||||
template<int> enum E : int { e }; // { dg-error "template declaration of" }
|
Loading…
Add table
Reference in a new issue