re PR c++/34603 (ICE with broken template declaration)

/cp
2008-01-24  Paolo Carlini  <pcarlini@suse.de>

        PR c++/34603
        * pt.c (push_template_decl_real): Return error_mark_node in case
	of template definition of non-template.

/testsuite
2008-01-24  Paolo Carlini  <pcarlini@suse.de>

        PR c++/34603
        * g++.dg/template/crash77.C: New.

From-SVN: r131804
This commit is contained in:
Paolo Carlini 2008-01-24 19:54:11 +00:00
parent 3371362cb0
commit 3fe82414fe
4 changed files with 20 additions and 3 deletions

View File

@ -1,10 +1,17 @@
2008-01-24 Paolo Carlini <pcarlini@suse.de>
PR c++/34603
* pt.c (push_template_decl_real): Return error_mark_node in case
of template definition of non-template.
2008-01-24 Jason Merrill <jason@redhat.com> 2008-01-24 Jason Merrill <jason@redhat.com>
PR c++/34913 PR c++/34913
* decl2.c (is_late_template_attribute): Defer any attribute with * decl2.c (is_late_template_attribute): Defer any attribute with
dependent args. Also defer type attributes if the type is dependent. dependent args. Also defer type attributes if the type is dependent.
2008-01-22 Jakub Jelinek <jakub@redhat.com>, Alexandre Oliva <aoliva@redhat.com> 2008-01-22 Jakub Jelinek <jakub@redhat.com>
Alexandre Oliva <aoliva@redhat.com>
PR c++/33984 PR c++/33984
* call.c (reference_binding): For bitfields use the declared bitfield * call.c (reference_binding): For bitfields use the declared bitfield

View File

@ -1,6 +1,6 @@
/* Handle parameterized types (templates) for GNU C++. /* Handle parameterized types (templates) for GNU C++.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. 2001, 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
Written by Ken Raeburn (raeburn@cygnus.com) while at Watchmaker Computing. Written by Ken Raeburn (raeburn@cygnus.com) while at Watchmaker Computing.
Rewritten by Jason Merrill (jason@cygnus.com). Rewritten by Jason Merrill (jason@cygnus.com).
@ -3977,7 +3977,7 @@ push_template_decl_real (tree decl, bool is_friend)
if (!tinfo) if (!tinfo)
{ {
error ("template definition of non-template %q#D", decl); error ("template definition of non-template %q#D", decl);
return decl; return error_mark_node;
} }
tmpl = TI_TEMPLATE (tinfo); tmpl = TI_TEMPLATE (tinfo);

View File

@ -1,3 +1,8 @@
2008-01-24 Paolo Carlini <pcarlini@suse.de>
PR c++/34603
* g++.dg/template/crash77.C: New.
2008-01-24 Uros Bizjak <ubizjak@gmail.com> 2008-01-24 Uros Bizjak <ubizjak@gmail.com>
PR target/34856 PR target/34856

View File

@ -0,0 +1,5 @@
// PR c++/34603
template<typename> struct A; // { dg-error "declaration" }
template<typename T> A<T>::A( struct A; // { dg-error "definition|expected|incomplete" }