Also updated a FIXME in Sema::CheckInitializer()...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44602
91177308-0d34-0410-b5e6-
96231b3b80d8
break;
case ParenExprClass: // C99 6.5.1p5
return cast<ParenExpr>(this)->getSubExpr()->isLvalue();
+ case CompoundLiteralExprClass: // C99 6.5.2.5p5
+ return LV_Valid;
case OCUVectorElementExprClass:
if (cast<OCUVectorElementExpr>(this)->containsDuplicateElements())
return LV_DuplicateVectorComponents;
hadError);
return hadError;
}
- // FIXME: Handle struct/union types.
+ // FIXME: Handle struct/union types, including those appearing in a
+ // CompoundLiteralExpr...
return hadError;
}
--- /dev/null
+// RUN: clang -fsyntax-only -verify %s
+
+struct foo { int a, b; };
+
+extern void fooFunc(struct foo *pfoo);
+
+int main(int argc, char **argv) {
+ fooFunc(&(struct foo){ 1, 2 });
+}
+