[llvm-bugs] [Bug 28954] New: basic streams may not be initialized early enough

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Aug 12 13:08:16 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=28954

            Bug ID: 28954
           Summary: basic streams may not be initialized early enough
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: dsturtevant at google.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com
    Classification: Unclassified

This is a bug that https://reviews.llvm.org/D12689 attempted to address.

The C++11 standard (Section 27.4.1.2) requires that basic streams be
initialized as if an inclusion of <iostream> statically defined an instance of
std::ios_base::Init.

The example given in the changelist:

#include <iostream>

class Foo {
public:
  Foo(int n) {
    std::cout << "Hello World - " << n << std::endl;
  }
};

Foo f(5);

int main() {
  return 0;
}

With the head version of libc++, this program may crash.

-- 
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/20160812/21a0460a/attachment.html>


More information about the llvm-bugs mailing list