public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "d dot frey at gmx dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/11357] New: no conversion of build-in binary operator argument attempted
Date: Sat, 28 Jun 2003 09:07:00 -0000	[thread overview]
Message-ID: <20030628090748.11357.d.frey@gmx.de> (raw)

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


             reply	other threads:[~2003-06-28  9:07 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-28  9:07 d dot frey at gmx dot de [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030628090748.11357.d.frey@gmx.de \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).