of the elements. Issue reported on cfe-dev by Mattias Holm.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73292
91177308-0d34-0410-b5e6-
96231b3b80d8
// compatible structure or union type. In the latter case, the
// initial value of the object, including unnamed members, is
// that of the expression.
- if (ElemType->isRecordType() &&
+ if ((ElemType->isRecordType() || ElemType->isVectorType()) &&
SemaRef.Context.hasSameUnqualifiedType(expr->getType(), ElemType)) {
UpdateStructuredListElement(StructuredList, StructuredIndex, expr);
++Index;
--- /dev/null
+// RUN: clang-cc -fsyntax-only -verify %s
+
+typedef float __attribute__((vector_size (16))) v4f_t;
+
+typedef union {
+ struct {
+ float x, y, z, w;
+ }s;
+ v4f_t v;
+} vector_t;
+
+
+vector_t foo(v4f_t p)
+{
+ vector_t v = {.v = p};
+ return v;
+}