public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11357] New: no conversion of build-in binary operator argument attempted
@ 2003-06-28  9:07 d dot frey at gmx dot de
  2003-06-28 18:00 ` [Bug c++/11357] " bangerth at dealii dot org
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: d dot frey at gmx dot de @ 2003-06-28  9:07 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11357

           Summary: no conversion of build-in binary operator argument
                    attempted
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: d dot frey at gmx dot de
                CC: gcc-bugs at gcc dot gnu dot org

Consider the following code snippet:

struct A {
    template< typename T > operator T() const;
} a;

template<> A::operator float() const
{
    return 1.0f;
}

int main()
{
    float f = 1.0f * a;
}

The GCC 3.3 says:

t.cc: In function `int main()':
t.cc:12: error: no match for `float * A&' operator
t.cc:12: warning: unused variable `float f'

which is probably incorrect. EDG-based compilers like the code and 5.6/2 and 5/9
suggest that they are right. The GCC seems to be unable to decide which
conversion is appopriate and thus fails to attempt to cast A to float. This is
in the GCC since (at least) 2.95.3.

Regards, Daniel


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

end of thread, other threads:[~2004-04-30  2:54 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-28  9:07 [Bug c++/11357] New: no conversion of build-in binary operator argument attempted d dot frey at gmx dot de
2003-06-28 18:00 ` [Bug c++/11357] " bangerth at dealii dot org
2003-06-28 18:06 ` nathan at gcc dot gnu dot org
2003-06-30  0:07 ` giovannibajo at libero dot it
2003-07-01  7:45 ` giovannibajo at libero dot it
2003-07-01  7:52 ` daniel dot frey at aixigo dot de
2003-07-01  8:27 ` giovannibajo at libero dot it
2003-08-04  0:30 ` pinskia at physics dot uc dot edu
2003-09-08  4:29 ` pinskia at gcc dot gnu dot org
2003-09-09 23:19 ` d dot frey at gmx dot de
2003-09-09 23:54 ` pinskia at gcc dot gnu dot org
2003-09-10  0:17 ` bangerth at dealii dot org
2003-09-10  1:17 ` gdr at integrable-solutions dot net
2003-09-10  1:51 ` bangerth at dealii dot org
2003-09-10  3:07 ` gdr at integrable-solutions dot net
2003-09-10 13:36 ` bangerth at dealii dot org
2003-09-17 18:29 ` cvs-commit at gcc dot gnu dot org
2003-09-17 22:07 ` gdr at gcc dot gnu dot org
2003-09-22  1:42 ` d dot frey at gmx dot de
2003-09-22  4:18 ` [Bug c++/11357] [DR 425?] " pinskia at gcc dot gnu dot org
2004-04-26 22:07 ` pinskia at gcc dot gnu dot org
2004-04-30  4:31 ` [Bug c++/11357] [DR 425] " pinskia at gcc dot gnu dot org

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).