public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/8856: g++ accepts invalid conversion-function-id
@ 2002-12-07 3:36 Martin von Loewis
0 siblings, 0 replies; 2+ messages in thread
From: Martin von Loewis @ 2002-12-07 3:36 UTC (permalink / raw)
To: gcc-gnats
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1384 bytes --]
>Number: 8856
>Category: c++
>Synopsis: g++ accepts invalid conversion-function-id
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: accepts-illegal
>Submitter-Id: net
>Arrival-Date: Sat Dec 07 03:36:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Martin v. Löwis
>Release: 3.1
>Organization:
>Environment:
System: SunOS paros 5.9 Generic_112233-02 sun4u sparc SUNW,Sun-Blade-1000
Architecture: sun4
host: sparc-sun-solaris2.8
build: sparc-sun-solaris2.8
target: sparc-sun-solaris2.8
configured with: ../configure --host=sparc-sun-solaris2.8 --enable-shared --enable-threads --with-cpu=v8 --with-gnu-ld --with-gnu-as --enable-version-specific-runtime-libs
>Description:
The following program is accepted, even though operator double<int>
is not a valid conversion-function-id (as double is not a template).
#include <stdio.h>
template <class T> struct A {
template <class U> operator U() { return sizeof(U); }
};
int main() {
A<double> a;
int x = a.A<double>::operator int();
double y = a.A<double>::operator double();
int z = a.A<double>::operator double<int>();
printf("%d %f %d\n", x, y, z);
}
>How-To-Repeat:
Compile the above program.
>Fix:
Work-around: don't use the construct.
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: c++/8856: g++ accepts invalid conversion-function-id
@ 2002-12-09 11:17 bangerth
0 siblings, 0 replies; 2+ messages in thread
From: bangerth @ 2002-12-09 11:17 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, loewis, nobody
Synopsis: g++ accepts invalid conversion-function-id
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Mon Dec 9 11:17:54 2002
State-Changed-Why:
Confirmed. Rather funny. Martin, how do you find such constructs?
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8856
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-12-09 19:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-07 3:36 c++/8856: g++ accepts invalid conversion-function-id Martin von Loewis
2002-12-09 11:17 bangerth
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).