On Sat, Nov 12, 2011 at 9:59 AM, Jonathan Wakely <jwakely....@gmail.com> wrote:
> This allows __promote to be used like enable_if to constrain the TR1
> and C++11 maths function overloads so they only work for floating
> point and integral types.
>
>        PR libstdc++/51083
>        * include/ext/type_traits.h (__promote): Only define __type member
>        for integral and floating point types, to prevent math functions
>        participating in overload resolution for other types.
>        (__promote_2, __promote_3, __promote_4): Use __promote in default
>        template argument values, so deduction only succeeds for integral and
>        floating point types.
>        * testsuite/26_numerics/cmath/51083.cc: New.
>        * testsuite/26_numerics/complex/51083.cc: New.
>        * testsuite/tr1/8_c_compatibility/cmath/51083.cc: New.
>        * testsuite/tr1/8_c_compatibility/complex/51083.cc: New.
>
> tested x86_64-linux, committed to trunk.
>
> I'm undecided whether this counts as a regression or not and if it
> should be applied to the 4.6 branch - the testcases worked before TR1
> was added or without -std=c++0x.
>

I'm OK with it everywhere.

Reply via email to