public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Delana.Lorenzo@libero.it
To: gcc-gnats@gcc.gnu.org
Subject: c++/8578: cast typename operator
Date: Wed, 20 Nov 2002 07:37:00 -0000	[thread overview]
Message-ID: <20021114064905.27899.qmail@sources.redhat.com> (raw)


>Number:         8578
>Category:       c++
>Synopsis:       cast typename operator
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Nov 13 22:56:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Delana.Lorenzo@libero.it
>Release:        gcc-3.2
>Organization:
>Environment:
Linux
>Description:
#include <iostream>
using namespace std;

template <class K>
class A
{
public:
typedef typename K::val val;
operator val ();
};

template <class K>
A<K>::operator val ()
{
printf ("cast operator\n");
}

struct myval{ typedef int val; };

int
main ()
{
 A<myval> a;
 (int)a;
}

/* if you define in the class header the cast operator
you don't get error like this:
template_cast_op.cxx:13: warning: `typename A<K>::val' is implicitly a typename
template_cast_op.cxx:13: warning: implicit typename is deprecated, please see
   the documentation for details
template_cast_op.cxx:14: no `A<K>::operator K::val()' member function declared
   in class `A<K>'
template_cast_op.cxx:14: template definition of non-template `A<K>::operator
   K::val()'
*/
>How-To-Repeat:
compile this source code
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2002-11-14  6:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-20  7:37 Delana.Lorenzo [this message]
2002-11-20 18:04 bangerth
2003-01-13  0:07 reichelt

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=20021114064905.27899.qmail@sources.redhat.com \
    --to=delana.lorenzo@libero.it \
    --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).