This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3] fix libstdc++/51083


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.

Attachment: 51083.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]