if (ParseAs == CompoundLiteral) {
ExprType = CompoundLiteral;
- // FIXME: This is entirely wrong.
- TypeResult Ty = ParseTypeName();
+ if (DeclaratorInfo.isInvalidType())
+ return ExprError();
+
+ TypeResult Ty = Actions.ActOnTypeName(getCurScope(), DeclaratorInfo);
return ParseCompoundLiteralExpression(Ty.get(),
Tracker.getOpenLocation(),
Tracker.getCloseLocation());
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -x c++ %s
// expected-no-diagnostics
int main() {
char *s;
- s = (char []){"whatever"};
+ s = (char []){"whatever"};
+ s = (char(*)){s};
}