This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [C++ Patch] for c++/54537
- From: Fabien Chêne <fabien dot chene at gmail dot com>
- To: Jason Merrill <jason at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, libstdc++ at gcc dot gnu dot org
- Cc: Paolo Carlini <paolo dot carlini at oracle dot com>
- Date: Tue, 18 Sep 2012 20:11:48 +0200
- Subject: Re: [C++ Patch] for c++/54537
- References: <CAFH4-dhvTpRyzTNpieNnZ=VMDcRE7+wikB4pk3dadFSNs0BK8g@mail.gmail.com> <504D3146.8070108@redhat.com> <CAFH4-dgOgUEgzumgy891xVUieU2vugGxw2=_-_ezdpfXzZV7RQ@mail.gmail.com> <CAFH4-dhcjdoYkxb7gLygQBwv9S02Lue9zoRFE0SBLwemLAc-uQ@mail.gmail.com> <ff93ce3c-2523-42b9-b801-96e667058527@email.android.com>
2012/9/18 Paolo Carlini <paolo.carlini@oracle.com>:
> I don't understand: what's wrong - exactly - with the std::tr1::pow (double, double) overload above? Now I can't immediately check, but do the EDG and CLANG front ends accept it or not?
They don't. The problem is that it conflicts with ::pow(double,double).
// in GLIBC math.h
extern double pow (double __x, double __y) throw (); // (1)
// in std::tr1::cmath
namespace std { namespace tr1 {
inline double
pow(double __x, double __y)
{ return std::pow(__x, __y); }
}}
// in std::tr1::math.h
using std::tr1::pow; // this one conflicts with (1)
The removal of std::tr1::pow is surely wrong, on second though, I
think we should perhaps do:
namespace std { namespace tr1 { using std::pow; }}
But I see the comment below in std::tr1::math.h...
// DR 550. What should the return type of pow(float,int) be?
// NB: C++0x and TR1 != C++03.
// using std::pow;
What do you think ?