[Boost-bugs] [Boost C++ Libraries] #12343: int128_t to int64_t cast error with apple clang

Subject: [Boost-bugs] [Boost C++ Libraries] #12343: int128_t to int64_t cast error with apple clang
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-07-22 08:41:55


#12343: int128_t to int64_t cast error with apple clang
------------------------------------------+----------------------------
 Reporter: Linqing Feng <fenglinqing@…> | Owner: johnmaddock
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: multiprecision
  Version: Boost 1.61.0 | Severity: Showstopper
 Keywords: |
------------------------------------------+----------------------------
 {{{
 #include <boost/multiprecision/cpp_int.hpp>
 #include <iostream>
 #include <cstdint>

 int main()
 {
   boost::multiprecision::int128_t a = INT64_MIN;
   std::cout << a << " "
             << INT64_MIN << " "
             << static_cast<int64_t>(a) << " "
             << std::endl;

   return 0;
 }
 }}}



 With apple clang (xcode 7.3.1):
 "clang++ -stdlib=libc++ -std=c++14 int128casterror.cpp
 -I/usr/local/include"
 the output is
 -9223372036854775808 -9223372036854775808 '''-9223372036854775807'''
 , while the correct output should be ([http://ideone.com/3UhgWQ]):
 -9223372036854775808 -9223372036854775808 -9223372036854775808

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