[LLVMbugs] [Bug 15913] New: conversion of a string to unsigned long long (ULLONG_MAX) fails.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun May 5 14:06:15 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=15913

            Bug ID: 15913
           Summary: conversion of a string to unsigned long long
                    (ULLONG_MAX) fails.
           Product: libc++
           Version: 3.2
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: hhinnant at apple.com
          Reporter: denis at ddenis.info
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

#include <iostream>
#include <sstream>

int main(int argc, char **argv)
{
  std::string s = "00000000000000000001777777777777777777777";
  std::istringstream ss(s);
  unsigned long long value;
  ss >> value;
  std::cout.flags(std::ios::hex | std::ios::showbase);
  std::cout << value;
}

$ clang++ -std=c++11 -stdlib=libc++ ./stringstreamtest.cpp
$ ./a.out
0xf6b75ab2bc471c71

Instead of expected
0xffffffffffffffff

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130505/9c7664e7/attachment.html>


More information about the llvm-bugs mailing list