patch to do array-to-pointer conversion in a

statement-expression. // rdar: //8600553

llvm-svn: 117479
This commit is contained in:
Fariborz Jahanian 2010-10-27 20:10:28 +00:00
parent 333b0a9e74
commit 5701585780
2 changed files with 12 additions and 0 deletions

View File

@ -7072,6 +7072,8 @@ Sema::ActOnStmtExpr(SourceLocation LPLoc, Stmt *SubStmt,
}
if (Expr *LastExpr = dyn_cast<Expr>(LastStmt)) {
Ty = LastExpr->getType();
if (Ty->isArrayType())
Ty = Context.getArrayDecayedType(Ty);
if (!Ty->isDependentType() && !LastExpr->isTypeDependent()) {
ExprResult Res = PerformCopyInitialization(
InitializedEntity::InitializeResult(LPLoc,

View File

@ -63,3 +63,13 @@ int main()
foo4();
return foo(1).i-1;
}
// rdar: // 8600553
int a[128];
int* foo5() {
// CHECK-NOT: memcpy
// Check that array-to-pointer conversion occurs in a
// statement-expression.
return (({ a; }));
}