c++/4423: Template operator overloading using member functions and bound friend templates fails

grendel@swcp.com grendel@swcp.com
Sat Sep 29 23:59:00 GMT 2001


>Number:         4423
>Category:       c++
>Synopsis:       Template operator overloading using member functions and bound friend templates fails
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 29 23:56:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Bill Reynolds
>Release:        unknown-1.0
>Organization:
>Environment:
Linux Redhat 7.0 i686
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-85)
>Description:
g++ cannot disambiguate two overloads of operator* if the arguments are templates and the class doing the overloading
uses both member fn overloads and friend template fn overloads.

Following code gives the compile error. This code compiles on 
the Comeau online compiler, and as far as I can tell is 
legal code.
>How-To-Repeat:

>Fix:
See (commented out) workaround in code.
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list