public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/9940: default conversion not applied to templated reference variable
@ 2003-03-04 15:46 apl
  0 siblings, 0 replies; 2+ messages in thread
From: apl @ 2003-03-04 15:46 UTC (permalink / raw)
  To: gcc-gnats


>Number:         9940
>Category:       c++
>Synopsis:       default conversion not applied to templated reference variable
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 04 15:46:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Alan Lehotsky
>Release:        gcc-3.2.2
>Organization:
>Environment:
Reading specs from /tools/linux/gcc-3.2.2/lib/gcc-lib/i686-pc-
ecs
Configured with: ./configure --prefix=/tools/linux/gcc-3.2.2
Thread model: posix
gcc version 3.2.2
>Description:
A templated class with a conversion operator to an integral type doesn't get chosen IF its being applied to a reference variable of the templated type.

This is similar to Gnats 383, but I think it's not the same problem...

If there is ALSO a non-reference variable of the templated type, then the conversion operator is found for both variables.

This works in SPARCWorks and Intel CC 7.0.  It also works correctly if it's a non-templated class with a conversion operator
>How-To-Repeat:
g++ -c try.cxx    // this fails
g++ -c -DWHAT try.cxx // this succeeds

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="try.cxx"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="try.cxx"

dGVtcGxhdGUgPHR5cGVuYW1lIFQ+IGNsYXNzIFRyaXN0YXRlCnsKICBUIG1EYXRhOwpwdWJsaWM6
CiAgIG9wZXJhdG9yIFQgKCkgeyByZXR1cm4gbURhdGE7fQp9OwoKY2xhc3MgT3RoZXIKewogIGlu
dCBtRGF0YTsKcHVibGljOgogIG9wZXJhdG9yIGludCgpIHsgcmV0dXJuIG1EYXRhO30KfTsKCmNs
YXNzIGNfbGR0X2NtcHBhZF9vdXQKewpwdWJsaWM6CiAgaW50IE5BTkRJOwogIGludCBOQU5ETzsK
ICBUcmlzdGF0ZTxpbnQ+ICAmUEFEOwogIE90aGVyICZCQVQ7CiNpZmRlZiBXSEFUCiAgVHJpc3Rh
dGU8aW50PiBPS0FZOwojZW5kaWYKICB2b2lkIGdvb2QgKHZvaWQpewogICAgTkFOREkgPSBOQU5E
TyArIEJBVDsKICB9CgogIHZvaWQgYmFkKHZvaWQpIHsKICAgIE5BTkRPID0gTkFOREkgKyBQQUQ7
CiAgfQoKI2lmZGVmIFdIQVQKICB2b2lkIG9rYXkgKHZvaWQpewogICAgTkFORE8gPSBOQU5ESSAr
IE9LQVk7CiAgfQojZW5kaWYKCiAgY19sZHRfY21wcGFkX291dChUcmlzdGF0ZTxpbnQ+JiBhX1BB
RCwgT3RoZXImIGFfQkFUICkKICAgIDogUEFEIChhX1BBRCksIEJBVCAoYV9CQVQpe30KfTsK


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

* Re: c++/9940: default conversion not applied to templated reference variable
@ 2003-03-04 15:57 bangerth
  0 siblings, 0 replies; 2+ messages in thread
From: bangerth @ 2003-03-04 15:57 UTC (permalink / raw)
  To: apl, gcc-bugs, gcc-prs, nobody

Synopsis: default conversion not applied to templated reference variable

State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Tue Mar  4 15:57:53 2003
State-Changed-Why:
    Confirmed, but already fixed in 3.3 and mainline.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9940


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

end of thread, other threads:[~2003-03-04 15:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-04 15:46 c++/9940: default conversion not applied to templated reference variable apl
2003-03-04 15:57 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).