public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/10136: Over-pedantic overloading errors
@ 2003-03-18 20:39 jason
  0 siblings, 0 replies; 2+ messages in thread
From: jason @ 2003-03-18 20:39 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, redwards

Synopsis: Over-pedantic overloading errors

State-Changed-From-To: open->closed
State-Changed-By: jason
State-Changed-When: Tue Mar 18 20:39:25 2003
State-Changed-Why:
    duplicate of 8316 and 9315

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


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

* c++/10136: Over-pedantic overloading errors
@ 2003-03-18 14:06 redwards
  0 siblings, 0 replies; 2+ messages in thread
From: redwards @ 2003-03-18 14:06 UTC (permalink / raw)
  To: gcc-gnats


>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:


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

end of thread, other threads:[~2003-03-18 20:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-18 20:39 c++/10136: Over-pedantic overloading errors jason
  -- strict thread matches above, loose matches on Subject: below --
2003-03-18 14:06 redwards

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