Commit 80d7287f by Paolo Carlini Committed by Paolo Carlini

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
parent de9f679d
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> 2008-06-02 Tomas Bily <tbily@suse.cz>
* typeck.c (is_bitfield_expr_with_lowered_type): Use CASE_CONVERT. * typeck.c (is_bitfield_expr_with_lowered_type): Use CASE_CONVERT.
......
...@@ -3791,7 +3791,10 @@ push_template_decl_real (tree decl, bool is_friend) ...@@ -3791,7 +3791,10 @@ push_template_decl_real (tree decl, bool is_friend)
member_template_p = true; member_template_p = true;
if (TREE_CODE (decl) == TYPE_DECL if (TREE_CODE (decl) == TYPE_DECL
&& ANON_AGGRNAME_P (DECL_NAME (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) else if (TREE_CODE (decl) == FUNCTION_DECL)
{ {
if (DECL_DESTRUCTOR_P (decl)) if (DECL_DESTRUCTOR_P (decl))
......
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> 2008-06-02 Daniel Kraft <d@domob.eu>
* finalize_1.f08: New test. * finalize_1.f08: New test.
......
...@@ -5,5 +5,5 @@ template<int> void foo(struct {}*); // { dg-error "" } ...@@ -5,5 +5,5 @@ template<int> void foo(struct {}*); // { dg-error "" }
void bar() void bar()
{ {
foo<0>(0); // { dg-error "" } foo<0>(0);
} }
// PR c++/36404
struct A
{
A(int);
template<int> enum { e }; // { dg-error "template" }
};
A a(A::e); // { dg-error "not a member" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment