[llvm-bugs] [Bug 38745] New: clang++ fails early initialization for function static variable
via llvm-bugs
llvm-bugs at lists.llvm.org
Tue Aug 28 10:50:29 PDT 2018
https://bugs.llvm.org/show_bug.cgi?id=38745
Bug ID: 38745
Summary: clang++ fails early initialization for function static
variable
Product: clang
Version: 6.0
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: timj at gnu.org
CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
Created attachment 20790
--> https://bugs.llvm.org/attachment.cgi?id=20790&action=edit
Demo for lack of initialization of a static variable at function scope
Code generated with clang version 4.0.1-6 or 6.0.0-1ubuntu2 crashes due to an
uninitialized unordered_map during execution of static ctors. The map should
have been initialized as a static variable during the first call to a singleton
accessor.
Various g++ versions (tested up to 7.2.0) produce properly working code for the
attached test case.
Note that moving the static unordered_map out of the singleton function into
global scope works and doesn't trigger the issue.
--
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/20180828/3e512836/attachment.html>
More information about the llvm-bugs
mailing list