[Boost-bugs] [Boost C++ Libraries] #4462: make_signed is not SFINAE friendly

Subject: [Boost-bugs] [Boost C++ Libraries] #4462: make_signed is not SFINAE friendly
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-07-22 12:12:23


#4462: make_signed is not SFINAE friendly
--------------------------------+-------------------------------------------
 Reporter: 1czajnik@… | Owner: johnmaddock
     Type: Bugs | Status: new
Milestone: Boost 1.44.0 | Component: type_traits
  Version: Boost 1.44.0 | Severity: Problem
 Keywords: sfinae |
--------------------------------+-------------------------------------------
 The following example doesn't compile:

 #include <boost/type_traits/make_signed.hpp>

 using namespace std;

 struct A
 {
         unsigned x_;
         explicit A( unsigned x ) : x_( x ) {}
 };

 template < class T >
 typename boost::make_signed<T>::type signed_value( T t )
 {
         return t;
 }

 int signed_value( A a )
 {
         return a.x_;
 }

 int main()
 {
         signed_value(1u);
         signed_value( A(1) );
 }

 Produces the following error on MinGW gcc-4.4:
 make_signed.hpp:39: error: invalid application of 'sizeof' to incomplete
 type 'boost::STATIC_ASSERTION_FAILURE<false>'

 tried with trunk 63079, and the 1.43 release

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4462>
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:03 UTC