forked from OSchip/llvm-project
patch to do array-to-pointer conversion in a
statement-expression. // rdar: //8600553 llvm-svn: 117479
This commit is contained in:
parent
333b0a9e74
commit
5701585780
|
@ -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,
|
||||
|
|
|
@ -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; }));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue