This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [C++ Patch] for c++/54537
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Fabien Chêne <fabien dot chene at gmail dot com>, Jason Merrill <jason at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, libstdc++ at gcc dot gnu dot org
- Date: Tue, 18 Sep 2012 19:59:53 +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>
Hi,
"Fabien ChÃne" <fabien.chene@gmail.com> ha scritto:
>2012/9/11 Fabien ChÃne <fabien.chene@gmail.com>:
>> Oops, not sure how I test that change initially, or I must be blind,
>> because it triggers an error in tr1/cmath about pow. I'll see what I
>> can do...
>
>Well, as summarized in the code below, the problem seems to be the
>redundant overload of std::tr1::pow(double,double). As one can note
>that std::pow(double,double) is not defined, I guess the right fix
>would consist in removing the definition of
>std::tr1::pow(double,double).
>
>extern double pow (double __x, double __y) throw ();
>
>namespace std
>{
> using ::pow;
>
> inline float
> pow(float __x, float __y)
> { return __builtin_powf(__x, __y); }
>
> inline long double
> pow(long double __x, long double __y)
> { return __builtin_powl(__x, __y); }
>}
>
>namespace std
>{
>namespace tr1
>{
> // inline double
> // pow(double __x, double __y)
> // { return std::pow(__x, __y); }
>
> inline float
> pow(float __x, float __y)
> { return std::pow(__x, __y); }
>
> inline long double
> pow(long double __x, long double __y)
> { return std::pow(__x, __y); }
>}
>}
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?
Paolo