Bug 8116 - [3.2 regression] ICE in member template function
|
Bug#:
8116
|
Product: gcc
|
Version: 3.2
|
|
Host: i686-pc-linux-gnu
|
Target: i686-pc-linux-gnu
|
Build: i686-pc-linux-gnu
|
|
Status: RESOLVED
|
Severity: normal
|
Priority: P3
|
|
Resolution: FIXED
|
Assigned To: unassigned@gcc.gnu.org
|
Reported By: yuvalk@mainsoft.com
|
|
Component: c++
|
Target Milestone: ---
|
|
Summary: [3.2 regression] ICE in member template function
|
|
Keywords: ice-on-valid-code
|
|
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){}
}
/*********************************************/
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.
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed for 3.3.