]> granicus.if.org Git - clang/commit
CodeGen: correct materialize temporary aggregates in ARC mode
authorSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 24 Oct 2014 20:23:43 +0000 (20:23 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 24 Oct 2014 20:23:43 +0000 (20:23 +0000)
commitd18dc4d8975eff2593f61ca51a6b7c4e3386a751
tree984a653c5b522063004dde5e8005c2755374f4fe
parent8667dd90bcef1f41a2a1c1bf827a0da11543383f
CodeGen: correct materialize temporary aggregates in ARC mode

Avoid an assertion when materializing a lifetime type aggregate temporary.  When
performing CodeGen for ObjC++, we could generate a lifetime-only aggregate
temporary by using an initializer list (which is effectively an array).  We
would reach through the temporary expression, fishing out the inner expression.
If this expression was a lifetime expression, we would attempt to emit this as a
scalar.  This would eventually result in an assertion as the emission would
eventually assert that the expression being emitted has a scalar evaluation
kind.

Add a case to handle the aggregate expressions.  Use the EmitAggExpr to emit the
aggregate expression rather than the EmitScalarInit.

Addresses PR21347.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220590 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGExpr.cpp
test/CodeGenObjCXX/arc-cxx11-init-list.mm [new file with mode: 0644]