When compiling this small file I get the following message: ........................................................... tmplbug.cpp: In function `void fff()': tmplbug.cpp:16: Internal compiler error in tsubst_decl, at cp/pt.c:5648 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions. ........................................................... This also happens if the template function is the constructor of com_ptr. In fact, any template function inside a template causes an ICE when it is called. GCC 2.95.3 compiles this code with no errors or warnings. Release: 3.2 Environment: System: Linux twins 2.4.18-3custom #1 SMP Thu Sep 19 12:30:28 IDT 2002 i686 unknown Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: ../gcc-3.2/configure --prefix=/usr/gcc/3.2 --enable-languages=c,c++ How-To-Repeat: /*********************************************/ /* Compile the following with `gcc -c x.cpp' */ /*********************************************/ template <class T> struct MY_PLACEHOLDER { static int m_iid; }; template <const int* iid> class com_ptr { public: com_ptr() { } template<typename Q> bool operator==(Q p){return 1;} }; void fff() { com_ptr<&MY_PLACEHOLDER<int>::m_iid> A; if(A==2){} } /*********************************************/
State-Changed-From-To: open->analyzed State-Changed-Why: Confirmed as a regression from GCC 3.0. The bug is fixed in the main line.
From: Reichelt <reichelt@igpm.rwth-aachen.de> To: gcc-gnats@gcc.gnu.org, yuvalk@mainsoft.com, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org Cc: Subject: Re: c++/8116: ICE in member template function Date: Sun, 27 Oct 2002 18:29:45 +0200 Hi, here's a little cleaned-up testcase: ---------------------snip here------------------------ template <typename T> struct A { static int i; }; template <int*> struct B { template <typename U> void bar(U); }; void foo() { B<&A<int>::i>().bar(0); } ---------------------snip here------------------------ Greetings, Volker http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8116
From: Janis Johnson <janis187@us.ibm.com> To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, yuvalk@mainsoft.com, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org Cc: Subject: Re: c++/8116: [3.2 regression] ICE in member template function Date: Mon, 23 Dec 2002 11:45:37 -0800 The patch that fixed the regression reported in PR c++/8116 was fixed with the following patch to the mainline: 2002-09-16 Nathan Sidwell <nathan@codesourcery.com> PR c++/7718 * pt.c (tsubst_decl): Remove assert. PR 8116 is a duplicate of PR 7718. They are both regressions from GCC 3.0.4 that still exist on the 3.2 branch. PR 7718 was not recognized as a regression. http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8116
State-Changed-From-To: analyzed->closed State-Changed-Why: Fixed for 3.3.