First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 8116
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: yuvalk@mainsoft.com
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 8116 depends on: Show dependency tree
Show dependency graph
Bug 8116 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: Opened: 2002-10-02 00:06
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){}
}
/*********************************************/

------- Comment #1 From Kriang Lerdsuwanakij 2002-10-27 06:48 -------
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.

------- Comment #2 From Volker Reichelt 2002-10-27 18:29 -------
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
 
 


------- Comment #3 From janis187@us.ibm.com 2002-12-23 11:45 -------
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
 
 
 

------- Comment #4 From Joe Buck 2003-04-25 21:20 -------
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed for 3.3.

First Last Prev Next    No search results available      Search page      Enter new bug