Handle init lists and _Atomic fields.
Fixes PR16931.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188718 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp
index 2844351..009e8c8 100644
--- a/lib/Sema/SemaInit.cpp
+++ b/lib/Sema/SemaInit.cpp
@@ -837,10 +837,14 @@
// C++ initialization is handled later.
}
- if (ElemType->isScalarType())
+ // FIXME: Need to handle atomic aggregate types with implicit init lists.
+ if (ElemType->isScalarType() || ElemType->isAtomicType())
return CheckScalarType(Entity, IList, ElemType, Index,
StructuredList, StructuredIndex);
+ assert((ElemType->isRecordType() || ElemType->isVectorType() ||
+ ElemType->isArrayType()) && "Unexpected type");
+
if (const ArrayType *arrayType = SemaRef.Context.getAsArrayType(ElemType)) {
// arrayType can be incomplete if we're initializing a flexible
// array member. There's nothing we can do with the completed