Boost logo

Boost :

Subject: Re: [boost] [type_traits][parameter] Inconsistent boost::is_convertible between gcc and clang
From: Michel Morin (mimomorin_at_[hidden])
Date: 2012-08-19 10:48:45


John Maddock wrote:
>> There three fixes for `is_convertible<From, To>` in the new code.
>> A. `To` is a function type.
>> B. `From` is an rvalue in C++11.
>> C. `From` is an rvalue in C++03.
>>
>> Patches (of the code and test) for A are attached in
>> https://svn.boost.org/trac/boost/ticket/7246
>> Since it is trivial to fix, may I commit it?
>
>
> Looks OK, yes please do go ahead.

Done.

> I'm not sure, the old code uses:
>
> sizeof(test_proc(variable))
>
> The new one uses:
>
> sizeof(test_proc(function_call()))
>
> I'm not sure if that counts as a SFINAE expression or not, but I remember
> similar code causing problems with MSVC (and probably others) when it was
> tried in type traits in the past. So I'm being extra careful!

I think if `sizeof(test_proc(variable))` works then
`sizeof(test_proc(function_call()))` works too.
But, OK, I don't know about VC++, so I use your code:
`_m_check(static_cast<rvalue_type>(_m_from))`.

I created a trac ticket at

    https://svn.boost.org/trac/boost/ticket/7251
    (is_convertible works incorrectly for rvalue source types)

and attached a patch for C++11 there

    https://svn.boost.org/trac/boost/attachment/ticket/7251/fix_is_convertible_for_rvalues_cxx11.patch

I'll make a patch for C++03 after the patch for C++11 is accepted.

Regards,
Michel


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk