http://llvm.org/bugs/show_bug.cgi?id=14772
Bug #: 14772
Summary: _Atomic types are not literal
Product: clang
Version: trunk
Platform: Macintosh
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: C++11
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
This silently breaks std::atomic initialized with ATOMIC_VAR_INIT which is
initialized dynamically instead of statically.
Related to: http://llvm.org/bugs/show_bug.cgi?id=11612
testatomic.cpp:
struct AtomicInt
{
_Atomic(int) Atomic;
};
AtomicInt GlobalAtomic0 = {0};
constexpr AtomicInt GlobalAtomic1 = {0};
clang -fsyntax-only -std=c++11 testatomic.cpp
testatomic.cpp:6:21: error: constexpr variable cannot have non-literal type
'const AtomicInt'
constexpr AtomicInt GlobalAtomic1 = {0};
^
testatomic.cpp:3:16: note: 'AtomicInt' is not literal because it has data
member 'Atomic' of non-literal type '_Atomic(int)'
_Atomic(int) Atomic;
^
1 error generated.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs