public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/6289: partial template specialization and friend
@ 2002-04-13 15:06 jototland
0 siblings, 0 replies; 6+ messages in thread
From: jototland @ 2002-04-13 15:06 UTC (permalink / raw)
To: gcc-gnats
>Number: 6289
>Category: c++
>Synopsis: partial template specialization and friend
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Apr 13 15:06:09 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Jo Totland
>Release: g++ 3.0.4, g++ 2.95.4
>Organization:
>Environment:
Debian testing distribution, self-compiled linux kernel version 2.4.18
>Description:
While doing something tricky with templates I got an internal compiler error.
jo@bogon:~/units$ g++-3.0 -ansi -Wall -c minimal.cc
minimal.cc:15: warning: `class my_frobnicator' declares a new type at namespace
scope;
to refer to the inherited type, say `class foo::type'
(names from dependent base classes are not visible to unqualified name
lookup)
minimal.cc:17: Internal compiler error in pop_binding, at cp/decl.c:1186
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
A minimal test program that triggers the bug is included.
>How-To-Repeat:
recompile the included test-program
>Fix:
no idea
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="minimal.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="minimal.cc"
dGVtcGxhdGUgPHR5cGVuYW1lIEE+IGNsYXNzIGZvbzsKCnN0cnVjdCBiYXIge307CgpzdHJ1Y3Qg
YmFyX2Zyb2JuaWNhdG9yIHt9OwoKdGVtcGxhdGUgPHR5cGVuYW1lIEE+CmNsYXNzIHdoaWNoX2Zy
b2JuaWNhdG9yOwp0ZW1wbGF0ZSA8PiBjbGFzcyB3aGljaF9mcm9ibmljYXRvcjxiYXI+IHsgdHlw
ZWRlZiBiYXJfZnJvYm5pY2F0b3IgdHlwZTsgfTsKCnRlbXBsYXRlIDx0eXBlbmFtZSBBPgpjbGFz
cyBmb28KewogIHR5cGVkZWYgdHlwZW5hbWUgd2hpY2hfZnJvYm5pY2F0b3I8QT46OnR5cGUgbXlf
ZnJvYm5pY2F0b3I7CiAgZnJpZW5kIGNsYXNzIG15X2Zyb2JuaWNhdG9yOwp9Cg==
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: c++/6289: partial template specialization and friend
@ 2002-05-14 8:10 lerdsuwa
0 siblings, 0 replies; 6+ messages in thread
From: lerdsuwa @ 2002-05-14 8:10 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, jototland, nobody
Synopsis: partial template specialization and friend
State-Changed-From-To: open->analyzed
State-Changed-By: lerdsuwa
State-Changed-When: Tue May 14 08:10:57 2002
State-Changed-Why:
As suggested in the follow up.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6289
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: c++/6289: partial template specialization and friend
@ 2002-05-08 4:46 Nathan Sidwell
0 siblings, 0 replies; 6+ messages in thread
From: Nathan Sidwell @ 2002-05-08 4:46 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/6289; it has been noted by GNATS.
From: Nathan Sidwell <nathan@acm.org>
To: Reichelt <reichelt@igpm.rwth-aachen.de>
Cc: gcc-gnats@gcc.gnu.org, jototland@hotmail.com, gcc-bugs@gcc.gnu.org,
nobody@gcc.gnu.org, bangerth@math.ethz.ch
Subject: Re: c++/6289: partial template specialization and friend
Date: Wed, 08 May 2002 12:34:04 +0100
Reichelt wrote:
>
> Hi,
>
> here's an even shorter example:
>
> ---------------------------snip here--------------------------
> template <typename T> class B
> {
> typedef int X;
> friend class X;
> };
> ---------------------------snip here--------------------------
>
> This is in fact legal code (and is accepted by SGI's and Comeau's
> compiler for example). It would be illegal, if the friend declaration
no it is ill formed. [7.1.5.3]/2 says
if the identifier resolves to a typedef name, or a template
type-parameter, the elaborated type specifier is ill-formed.
nathan
--
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
The voices in my head told me to say this
nathan@acm.org http://www.cs.bris.ac.uk/~nathan/ nathan@cs.bris.ac.uk
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: c++/6289: partial template specialization and friend
@ 2002-05-08 3:26 Reichelt
0 siblings, 0 replies; 6+ messages in thread
From: Reichelt @ 2002-05-08 3:26 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/6289; it has been noted by GNATS.
From: Reichelt <reichelt@igpm.rwth-aachen.de>
To: gcc-gnats@gcc.gnu.org, jototland@hotmail.com, gcc-bugs@gcc.gnu.org,
nobody@gcc.gnu.org, bangerth@math.ethz.ch
Cc:
Subject: Re: c++/6289: partial template specialization and friend
Date: Wed, 8 May 2002 12:52:10 +0200
Hi,
here's an even shorter example:
---------------------------snip here--------------------------
template <typename T> class B
{
typedef int X;
friend class X;
};
---------------------------snip here--------------------------
This is in fact legal code (and is accepted by SGI's and Comeau's
compiler for example). It would be illegal, if the friend declaration
read "friend class B<T>::X", but this way "friend class X" refers to a
class outside of B (which hasn't been defined yet). If you add
"class X;" before the definiton of B then the ICE vanishes.
Greetings,
Volker Reichelt
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6289
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: c++/6289: partial template specialization and friend
@ 2002-05-08 1:46 Wolfgang Bangerth
0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Bangerth @ 2002-05-08 1:46 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/6289; it has been noted by GNATS.
From: Wolfgang Bangerth <bangerth@math.ethz.ch>
To: reichelt@igpm.rwth-aachen.de, <gcc-gnats@gcc.gnu.org>,
<jototland@hotmail.com>, <gcc-bugs@gcc.gnu.org>
Cc:
Subject: Re: c++/6289: partial template specialization and friend
Date: Wed, 8 May 2002 10:36:26 +0200 (CEST)
> the testcase can be reduced even further to the following code snippet
> which still crashes gcc 3.1 as of 20020506.
>
> ---------------------------snip here--------------------------
> struct A
> {
> typedef int type;
> };
>
> template <typename T>
> class B
> {
> typedef A::type X;
> friend class X;
> };
> ---------------------------snip here--------------------------
This is illegal, by the way, as a _real_ class is expected in a friend
declaration, not a typedef. Someone may reclassify this bug as
ice-on-illegal then.
Regards
Wolfgang
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth@math.ethz.ch
www: http://www.math.ethz.ch/~bangerth
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: c++/6289: partial template specialization and friend
@ 2002-05-07 15:16 Reichelt
0 siblings, 0 replies; 6+ messages in thread
From: Reichelt @ 2002-05-07 15:16 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/6289; it has been noted by GNATS.
From: Reichelt <reichelt@igpm.rwth-aachen.de>
To: gcc-gnats@gcc.gnu.org, jototland@hotmail.com, gcc-bugs@gcc.gnu.org,
nobody@gcc.gnu.org
Cc:
Subject: Re: c++/6289: partial template specialization and friend
Date: Wed, 8 May 2002 00:42:23 +0200
Hi,
the testcase can be reduced even further to the following code snippet
which still crashes gcc 3.1 as of 20020506.
---------------------------snip here--------------------------
struct A
{
typedef int type;
};
template <typename T>
class B
{
typedef A::type X;
friend class X;
};
---------------------------snip here--------------------------
Greetings,
Volker Reichelt
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6289
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-05-14 15:10 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-13 15:06 c++/6289: partial template specialization and friend jototland
2002-05-07 15:16 Reichelt
2002-05-08 1:46 Wolfgang Bangerth
2002-05-08 3:26 Reichelt
2002-05-08 4:46 Nathan Sidwell
2002-05-14 8:10 lerdsuwa
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).