public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/8273: g++ can not generate an instance of a template containg a template instance
@ 2002-11-01 6:08 lerdsuwa
0 siblings, 0 replies; 4+ messages in thread
From: lerdsuwa @ 2002-11-01 6:08 UTC (permalink / raw)
To: bill, gcc-bugs, gcc-prs, lerdsuwa
Synopsis: g++ can not generate an instance of a template containg a template instance
State-Changed-From-To: analyzed->closed
State-Changed-By: lerdsuwa
State-Changed-When: Fri Nov 1 06:08:27 2002
State-Changed-Why:
Fixed in the main trunk.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8273
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: c++/8273: g++ can not generate an instance of a template containg a template instance
@ 2002-10-26 1:48 lerdsuwa
0 siblings, 0 replies; 4+ messages in thread
From: lerdsuwa @ 2002-10-26 1:48 UTC (permalink / raw)
To: bill, gcc-bugs, gcc-prs, lerdsuwa, nobody
Synopsis: g++ can not generate an instance of a template containg a template instance
Responsible-Changed-From-To: unassigned->lerdsuwa
Responsible-Changed-By: lerdsuwa
Responsible-Changed-When: Sat Oct 26 01:48:01 2002
Responsible-Changed-Why:
Patch in progress.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8273
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: c++/8273: g++ can not generate an instance of a template containg a template instance
@ 2002-10-23 5:43 lerdsuwa
0 siblings, 0 replies; 4+ messages in thread
From: lerdsuwa @ 2002-10-23 5:43 UTC (permalink / raw)
To: bill, gcc-bugs, gcc-prs, nobody
Synopsis: g++ can not generate an instance of a template containg a template instance
State-Changed-From-To: open->analyzed
State-Changed-By: lerdsuwa
State-Changed-When: Wed Oct 23 05:43:22 2002
State-Changed-Why:
Confirmed. The code is valid according to core issue 287 (currently under review).
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8273
^ permalink raw reply [flat|nested] 4+ messages in thread
* c++/8273: g++ can not generate an instance of a template containg a template instance
@ 2002-10-17 17:16 bill
0 siblings, 0 replies; 4+ messages in thread
From: bill @ 2002-10-17 17:16 UTC (permalink / raw)
To: gcc-gnats
>Number: 8273
>Category: c++
>Synopsis: g++ can not generate an instance of a template containg a template instance
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Thu Oct 17 17:16:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: W. Beckett
>Release: gcc-3.1.1
>Organization:
>Environment:
Red Hat Linux 7.3. binutil-2.13 and gcc-3.1.1 were pulled
from the GNU site and configured with all default options
>Description:
Given two structure templates M and X, an attempt to
include an instance of M parameterized by a member
function of X in X results in a syntax error when
X is instantiated. More detail is given in annotations
in the following short program.
>How-To-Repeat:
g++ -static the above program
>Fix:
The technique does not seem to be usable -- the fix is
to try something else.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="t4.cpp"
Content-Disposition: inline; filename="t4.cpp"
/* The following template is intended to take a structure */
/* and a pointer to a member function of that structure */
/* as template parameters. */
template <class T, int (T::*f)()> struct M {};
/* The following template defines a set of structures */
/* all of which include a member function int p(). The */
/* idea is for this member function to be used as an actual */
/* template parameter when generating an instance of M. */
template <class A>
struct X
{
A a;
int p() {}
M<X,X::p> m;
};
/* However, an attempt to instantiate an instance of X */
/* will not compile. */
main()
{
X<int> x;
}
/* Note that this program produces the following error */
/* messages -- */
/* t4.cpp: In instantiation of `X<int>': */
/* t4.cpp:28: instantiated from here */
/* t4.cpp:20: `p' is not a member of type `X<int>' */
/* Note also that this program does compile using the */
/* Sun Microsystems compiler, Forte Developer 7 C++ */
/* 5.4 2002/03/09 running on a Sparc Ultra 30 under Solaris */
/* 8 and also using the HP (formerly Compaq) compiler, */
/* Compaq C++ V6.3-008 for Tru64 UNIX V5.1A (Rev. 1885) */
/* running on an alpha. */
/* The Microsoft compiler included with Visual Studio, */
/* version 6, however, also does not compile the example */
/* but produces instead the following error messages -- */
/* $ cl -c -nologo -MD -W3 -GX -O2 -I 'F:\development\DevStudio\VC\include' \ */
/* -D WIN32 -D NDEBUG -D _WINDOWS -D _AFXDLL -D _MBCS t4.cpp */
/* t4.cpp */
/* t4.cpp(20) : error C2955: 'X' : use of class template requires template argument list */
/* t4.cpp(20) : error C2955: 'X' : use of class template requires template argument list */
/* t4.cpp(20) : error C2027: use of undefined type 'X<int>' */
/* t4.cpp(20) : error C2327: 'X<int>::p' : member from enclosing class is not a type name, */
/* static, or enumerator */
/* t4.cpp(20) : error C2065: 'p' : undeclared identifier */
/* t4.cpp(20) : error C2955: 'M' : use of class template requires template argument list */
/* t4.cpp(20) : warning C4200: nonstandard extension used : zero-sized array in struct/union */
/* t4.cpp(20) : fatal error C1903: unable to recover from previous error(s); stopping */
/* compilation */
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-11-01 14:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-01 6:08 c++/8273: g++ can not generate an instance of a template containg a template instance lerdsuwa
-- strict thread matches above, loose matches on Subject: below --
2002-10-26 1:48 lerdsuwa
2002-10-23 5:43 lerdsuwa
2002-10-17 17:16 bill
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).