http://llvm.org/bugs/show_bug.cgi?id=14122
Bug #: 14122
Summary: a union member with a non-trivial constructor due to
an in-class initializer crashes clang
Product: clang
Version: trunk
Platform: PC
OS/Version: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: C++11
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
The following code causes clang trunk to crash
// clang++ -std=c++11 test.cpp
struct S {
int i = 1;
};
union U {
S s;
} u;
with the output:
found no explanation for non-trivial member
UNREACHABLE executed at [...]\llvm\tools\clang\lib\Sema\SemaDecl.cpp:9827!
The issue is that Sema::DiagnoseNontrivial doesn't yet handle C++11 in-class
initializers. (it also doesn't handle other C++11 things, such as that user
declared constructors can still be trivial...)
--
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