public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/3396: template conversion operator
@ 2001-06-25  0:56 Axel.Zeuner
  0 siblings, 0 replies; 2+ messages in thread
From: Axel.Zeuner @ 2001-06-25  0:56 UTC (permalink / raw)
  To: gcc-gnats

>Number:         3396
>Category:       c++
>Synopsis:       template conversion operator
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 25 00:56:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Axel Zeuner
>Release:        2.95.2, 3.0-release, 3.0.1 (prerelease)
>Organization:
>Environment:
Solaris 2.6, Linux
>Description:
Conversion operators of templates classes to typenames typedefed in the template class work only in the body.
>How-To-Repeat:
Compile the test program attached.
>Fix:
Implement conversion operators in templates in the class
body.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="main.cpp"
Content-Disposition: inline; filename="main.cpp"

template <class T>
class X {
public:
    typedef T* XY;
    operator XY();
};

template <class T>
X<T>::operator X<T>::XY()
{
    return XY(0);
}

int main()
{
    X<int> p;
    int* pp=p;
    int rc=0;
    if ( pp!= 0) {
	rc=1;
    }
    return rc;
}


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: c++/3396: template conversion operator
@ 2001-08-12  1:35 gdr
  0 siblings, 0 replies; 2+ messages in thread
From: gdr @ 2001-08-12  1:35 UTC (permalink / raw)
  To: Axel.Zeuner, gcc-bugs, gcc-prs, gdr, nobody

Synopsis: template conversion operator

Responsible-Changed-From-To: unassigned->gdr
Responsible-Changed-By: gdr
Responsible-Changed-When: Sun Aug 12 01:35:52 2001
Responsible-Changed-Why:
    See below.
State-Changed-From-To: open->closed
State-Changed-By: gdr
State-Changed-When: Sun Aug 12 01:35:52 2001
State-Changed-Why:
    GCC-2.95.2 and GCC-3.0.1 compile your program fine.
    
    -- Gaby

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3396&database=gcc


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-08-12  1:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-25  0:56 c++/3396: template conversion operator Axel.Zeuner
2001-08-12  1:35 gdr

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).