public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Axel.Zeuner@systor.com
To: gcc-gnats@gcc.gnu.org
Subject: c++/3396: template conversion operator
Date: Mon, 25 Jun 2001 00:56:00 -0000	[thread overview]
Message-ID: <20010625075335.15651.qmail@sourceware.cygnus.com> (raw)

>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;
}


             reply	other threads:[~2001-06-25  0:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-25  0:56 Axel.Zeuner [this message]
2001-08-12  1:35 gdr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010625075335.15651.qmail@sourceware.cygnus.com \
    --to=axel.zeuner@systor.com \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).