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: unassignedclangb...@nondot.org
Reporter: t...@gnu.org
CC: dgre...@apple.com, llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs