From f60a10e71defb7b9e57ec668dc3710424bffbdc6 Mon Sep 17 00:00:00 2001 From: Kriang Lerdsuwanakij Date: Thu, 24 Jul 2003 11:56:33 +0000 Subject: [PATCH] re PR c++/11513 (ICE in push_template_decl_real cp/pt.c:2755, template member functions) PR c++/11513 * cp-tree.h (PROCESSING_REAL_TEMPLATE_DECL_P): Use current_scope. * g++.dg/template/crash8.C: New test. From-SVN: r69739 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/cp-tree.h | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/template/crash8.C | 20 ++++++++++++++++++++ 4 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/template/crash8.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3314b35c158..337b372e27e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2003-07-24 Kriang Lerdsuwanakij + + PR c++/11513 + * cp-tree.h (PROCESSING_REAL_TEMPLATE_DECL_P): Use current_scope. + 2003-07-23 Mark Mitchell PR c++/11645 diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 15bcea07eee..8e3fcf7701a 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -2838,7 +2838,7 @@ struct lang_decl GTY(()) entity with its own template parameter list, and which is not a full specialization. */ #define PROCESSING_REAL_TEMPLATE_DECL_P() \ - (processing_template_decl > template_class_depth (current_class_type)) + (processing_template_decl > template_class_depth (current_scope ())) /* Nonzero if this VAR_DECL or FUNCTION_DECL has already been instantiated, i.e. its definition has been generated from the diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4881e5ae45b..a362729dc84 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-07-24 Kriang Lerdsuwanakij + + PR c++/11513 + * g++.dg/template/crash8.C: New test. + 2003-07-23 Steven Bosscher PR c/10602 diff --git a/gcc/testsuite/g++.dg/template/crash8.C b/gcc/testsuite/g++.dg/template/crash8.C new file mode 100644 index 00000000000..a6f26b30679 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/crash8.C @@ -0,0 +1,20 @@ +// { dg-do compile } + +// Origin: David Robinson + +// PR c++/11513: ICE due to incorrect decision whether the tag is template. + +template +struct bar +{ + struct foo + { + int a; + }; + + template + int wom(U c) + { + struct foo b; + } +};