public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: redwards@astro.uva.nl To: gcc-gnats@gcc.gnu.org Subject: c++/10136: Over-pedantic overloading errors Date: Tue, 18 Mar 2003 14:06:00 -0000 [thread overview] Message-ID: <20030318140511.21858.qmail@sources.redhat.com> (raw) >Number: 10136 >Category: c++ >Synopsis: Over-pedantic overloading errors >Confidential: no >Severity: critical >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Tue Mar 18 14:06:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: R. Edwards >Release: 3.2 >Organization: >Environment: i486-suse-linux >Description: Sorry I don't know the ins and outs of the Standard well enough to know if this is a "new bug" and not just an "annoying new feature", but the fact that the following code dies with an error message seems strange to me. #include <cmath> void f() { float a, b=1.0; a = std::pow(b, 1.5); } Surely the compiler should just promote b to a double without even emitting a warning message? If not, what is the proper way to do this? Stick (double) in a zillion places in the code? Also, the error message for this kind of error is pretty cryptic, especially in the case of operators. Here is an example from my code, which is much too big and ugly to supply here: pbird.cc:102: choosing `PhysData::PhysDataPoint<T> PhysData::operator*(const PhysData::PhysDataPoint<T>&, double) [with T = double]' over `operator*' pbird.cc:102: because worst conversion for the former is better than worst conversion for the latter Firstly, great you made the right choice, why are you giving an error message about it?? Secondly, choosing it over _which_ operator* ?? (I know there is a previous bug report on this but no progress seemed to be made) >How-To-Repeat: g++ -c (file containing fragment in description) >Fix: >Release-Note: >Audit-Trail: >Unformatted:
next reply other threads:[~2003-03-18 14:06 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2003-03-18 14:06 redwards [this message] 2003-03-18 20:39 jason
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=20030318140511.21858.qmail@sources.redhat.com \ --to=redwards@astro.uva.nl \ --cc=gcc-gnats@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: linkBe 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).