Opened 6 years ago

Closed 6 years ago

#12343 closed Bugs (fixed)

int128_t to int64_t cast error with apple clang

Reported by: Linqing Feng <fenglinqing@…> Owned by: John Maddock
Milestone: Boost 1.62.0 Component: multiprecision
Version: Boost 1.61.0 Severity: Showstopper
Keywords: Cc:

Description

#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

Change History (1)

comment:1 by John Maddock, 6 years ago

Milestone: To Be DeterminedBoost 1.62.0
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.