[Boost-bugs] [Boost C++ Libraries] #10267: boost::enable_if_c incorrect result on IBM xlC compiler

Subject: [Boost-bugs] [Boost C++ Libraries] #10267: boost::enable_if_c incorrect result on IBM xlC compiler
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-07-28 23:36:57


#10267: boost::enable_if_c incorrect result on IBM xlC compiler
------------------------------------+------------------------------
 Reporter: Daniel Beer <dbeer1@…> | Type: Bugs
   Status: new | Milestone: To Be Determined
Component: None | Version: Boost 1.55.0
 Severity: Problem | Keywords:
------------------------------------+------------------------------
 Getting unexpected results when using boost::enable_if_c with
 boost::is_same on the IBM xlC, while Sun Studio and gcc yield the correct
 result:

 Test program test.cpp:
 {{{
 #include <boost/utility/enable_if.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <iostream>

 template<typename Key, class Enable = void>
 struct not_bool {
     static const bool value = false;
 };

 template<typename Key>
 struct not_bool<Key, typename boost::enable_if_c<
                                     !boost::is_same<Key,
 bool>::value>::type> {
     static const bool value = true;
 };

 int main(int argc, char **argv) {
     std::cout << not_bool<bool>::value << std::endl;
     std::cout << not_bool<unsigned long>::value << std::endl;

     return 0;
 }
 }}}

 Using xlC:
 {{{
 $ xlC_r -qversion
 IBM XL C/C++ for AIX, V11.1 (5724-X13)
 Version: 11.01.0000.0010
 $ xlC_r test.cpp -o test
 $ ./test
 0
 0
 }}}

 Using Sun Studio:
 {{{
 $ CC -V
 CC: Sun C++ 5.10 SunOS_sparc Patch 128228-25 2013/02/20
 $ CC test.cpp -o test
 $ ./test
 0
 1
 }}}

 Using gcc:
 {{{
 $ g++ -v
 gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
 $ g++ test.cpp -o test
 $ ./test
 0
 1
 }}}

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