public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/8116: ICE in member template function
@ 2002-10-02 0:06 yuvalk
0 siblings, 0 replies; 3+ messages in thread
From: yuvalk @ 2002-10-02 0:06 UTC (permalink / raw)
To: gcc-gnats; +Cc: dekelc, jluu, zoharm
>Number: 8116
>Category: c++
>Synopsis: ICE in member template function
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Wed Oct 02 00:06:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Yuval Kfir
>Release: 3.2
>Organization:
Mainsoft Co. Ltd.
>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++
>Description:
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.
>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){}
}
/*********************************************/
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: c++/8116: ICE in member template function
@ 2002-10-27 7:46 Reichelt
0 siblings, 0 replies; 3+ messages in thread
From: Reichelt @ 2002-10-27 7:46 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/8116; it has been noted by GNATS.
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: c++/8116: ICE in member template function
@ 2002-10-27 6:48 lerdsuwa
0 siblings, 0 replies; 3+ messages in thread
From: lerdsuwa @ 2002-10-27 6:48 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, yuvalk
Synopsis: ICE in member template function
State-Changed-From-To: open->analyzed
State-Changed-By: lerdsuwa
State-Changed-When: Sun Oct 27 06:48:46 2002
State-Changed-Why:
Confirmed as a regression from GCC 3.0. The bug is fixed in the main line.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8116
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-10-27 15:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-02 0:06 c++/8116: ICE in member template function yuvalk
2002-10-27 6:48 lerdsuwa
2002-10-27 7:46 Reichelt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).