This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ Patch] PR 20463
- From: Paolo Carlini <pcarlini at suse dot de>
- To: "'gcc-patches at gcc dot gnu dot org'" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 18 Mar 2005 14:07:46 +0100
- Subject: [C++ Patch] PR 20463
Hi,
this one is slightly more serious, an ice-on-illegal present only
in 4_0-branch and mainline.
Tested x86-linux. Ok somewhere?
Paolo.
/////////////////
cp/
PR c++/20463
* parser.c (cp_parser_diagnose_invalid_type_name):
Check TYPE_BINFO (current_class_type) before attempting
to emit inform messages.
testsuite/
PR c++/20463
* g++.dg/template/crash35.C: New test.
Index: parser.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/parser.c,v
retrieving revision 1.321
diff -p -r1.321 parser.c
*** parser.c 14 Mar 2005 14:33:26 -0000 1.321
--- parser.c 18 Mar 2005 12:58:18 -0000
*************** cp_parser_diagnose_invalid_type_name (cp
*** 1995,2001 ****
template <typename T> struct B : public A<T> { X x; };
The user should have said "typename A<T>::X". */
! if (processing_template_decl && current_class_type)
{
tree b;
--- 1995,2002 ----
template <typename T> struct B : public A<T> { X x; };
The user should have said "typename A<T>::X". */
! if (processing_template_decl && current_class_type
! && TYPE_BINFO (current_class_type))
{
tree b;
// PR c++/20463
// { dg-do compile }
template <typename T> struct C; // { dg-error "declaration" }
template <typename T> void C<T>::f() // { dg-error "invalid|template" }
{
const foo bar; // { dg-error "name a type" }
}