re PR c++/36404 (ICE with invalid enum)

/cp
2008-06-02  Paolo Carlini  <paolo.carlini@oracle.com>

        PR c++/36404
        * pt.c (push_template_decl_real): Consistently return error_mark_node
	on error.

/testsuite
2008-06-02  Paolo Carlini  <paolo.carlini@oracle.com>

        PR c++/36404
        * g++.dg/template/crash79.C: New.
	* g++.dg/other/pr28114.C: Adjust.

From-SVN: r136295
This commit is contained in:
Paolo Carlini 2008-06-02 21:27:35 +00:00 committed by Paolo Carlini
parent de9f679dbe
commit 80d7287f40
5 changed files with 26 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2008-06-02 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/36404
* pt.c (push_template_decl_real): Consistently return error_mark_node
on error.
2008-06-02 Tomas Bily <tbily@suse.cz>
* typeck.c (is_bitfield_expr_with_lowered_type): Use CASE_CONVERT.

View File

@ -3791,7 +3791,10 @@ push_template_decl_real (tree decl, bool is_friend)
member_template_p = true;
if (TREE_CODE (decl) == TYPE_DECL
&& ANON_AGGRNAME_P (DECL_NAME (decl)))
error ("template class without a name");
{
error ("template class without a name");
return error_mark_node;
}
else if (TREE_CODE (decl) == FUNCTION_DECL)
{
if (DECL_DESTRUCTOR_P (decl))

View File

@ -1,3 +1,9 @@
2008-06-02 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/36404
* g++.dg/template/crash79.C: New.
* g++.dg/other/pr28114.C: Adjust.
2008-06-02 Daniel Kraft <d@domob.eu>
* finalize_1.f08: New test.

View File

@ -5,5 +5,5 @@ template<int> void foo(struct {}*); // { dg-error "" }
void bar()
{
foo<0>(0); // { dg-error "" }
foo<0>(0);
}

View File

@ -0,0 +1,9 @@
// PR c++/36404
struct A
{
A(int);
template<int> enum { e }; // { dg-error "template" }
};
A a(A::e); // { dg-error "not a member" }