Re: [Boost-bugs] [Boost C++ Libraries] #7251: is_convertible works incorrectly for rvalue source types

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7251: is_convertible works incorrectly for rvalue source types
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-08-30 16:31:55


#7251: is_convertible works incorrectly for rvalue source types
--------------------------------------+-------------------------------------
  Reporter: michel | Owner: johnmaddock
      Type: Patches | Status: new
 Milestone: To Be Determined | Component: type_traits
   Version: Boost Development Trunk | Severity: Problem
Resolution: | Keywords:
--------------------------------------+-------------------------------------

Comment (by michel):

 Hi John,

 Thanks for looking into the problem.
 [[BR]][[BR]]

> I've applied the patch, but restricted it's application to GCC to
 versions 4.7 and later - earlier versions don't build the test suite with
 the patch applied :-[[BR]]
> (Versions 4.5.x and 4.6.x fail to build with function types,

 gcc 4.3-4.6 implements C++0x drafts, and there are some inconsistencies
 with C++11.
 For example,
 * gcc 4.3-4.4: rvalue references can be bound to lvalues.
 * gcc 4.5-4.6: rvalue references to function type is not an lvalue. So,
 for a function type `Func`, `Func&` cannot be bound to `Func&&`.
 Accordingly, `is_convertible<Func, Func&>` returns different results than
 C++11 and this causes the test failures.
 [[BR]]

> while version 4.4.x fails with just about everything.[[BR]][[BR]]
> It's possible that an extra #if branch for SFINAE-expressions could fix
 the remaining issues, but equally it might just break more stuff :-(

 Since `T` is not a dependent type in`_m_check`, SFINAE is not related.
 Indeed, the errors on gcc 4.3-4.4 can be reproduced without using
 templates. (And note that gcc 4.4 supports SFINAE for expressions.) I
 guess that the reason for the test failures on gcc 4.3-4.4 is a compiler's
 bug related to rvalue references.

 `#if` branch is not needed for `BOOST_NO_SFINAE_EXPR`, but is needed for
 `__GNUC__ == 4 && (__GNUC_MINOR__ == 3 || __GNUC_MINOR__ == 4)`.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7251#comment:4>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:10 UTC