public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/8578: cast typename operator
@ 2002-11-20 7:37 Delana.Lorenzo
0 siblings, 0 replies; 3+ messages in thread
From: Delana.Lorenzo @ 2002-11-20 7:37 UTC (permalink / raw)
To: gcc-gnats
>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:
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: c++/8578: cast typename operator
@ 2003-01-13 0:07 reichelt
0 siblings, 0 replies; 3+ messages in thread
From: reichelt @ 2003-01-13 0:07 UTC (permalink / raw)
To: Delana.Lorenzo, gcc-bugs, gcc-prs, nobody
Synopsis: cast typename operator
State-Changed-From-To: analyzed->closed
State-Changed-By: reichelt
State-Changed-When: Sun Jan 12 16:07:12 2003
State-Changed-Why:
The bug is fixed in gcc 3.3-20021230 and mainline.
(Testcase in preparation.)
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8578
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: c++/8578: cast typename operator
@ 2002-11-20 18:04 bangerth
0 siblings, 0 replies; 3+ messages in thread
From: bangerth @ 2002-11-20 18:04 UTC (permalink / raw)
To: Delana.Lorenzo, gcc-bugs, gcc-prs, nobody
Synopsis: cast typename operator
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Thu Nov 14 07:23:53 2002
State-Changed-Why:
Confirmed. This is a slightly simpler case:
---------------------------
template <class K> struct A {
typedef typename K::val val;
operator val ();
};
template <class K>
A<K>::operator typename A<K>::val () {}
----------------------------------
I'm quite sure there are duplicated of this in the database,
but can't seem to find them.
W.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8578
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-01-13 0:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-20 7:37 c++/8578: cast typename operator Delana.Lorenzo
2002-11-20 18:04 bangerth
2003-01-13 0:07 reichelt
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).