<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Assertion failed: (E && hasScalarEvaluationKind(E->getType()) && "Invalid scalar expression to emit")"
href="http://llvm.org/bugs/show_bug.cgi?id=21347">21347</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Assertion failed: (E && hasScalarEvaluationKind(E->getType()) && "Invalid scalar expression to emit")
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>LLVM Codegen
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>compnerd@compnerd.org
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Objective-C++ ARC CodeGen seems incorrect.
Consider the following input:
typedef __SIZE_TYPE__ size_t;
namespace std {
template <typename _Ep>
class initializer_list {
const _Ep *__begin_;
size_t __size_;
initializer_list(const _Ep *__b, size_t __size);
};
}
@interface NSObject
+ (instancetype) new;
@end
void function(std::initializer_list<NSObject *>);
void single() { function({ [NSObject new] }); }
void multiple() { function({ [NSObject new], [NSObject new] }); }
std::initializer_list<NSObject *> il = { [NSObject new] };
In all of these cases, the interesting bit is the intializer_list construction.
The materialization will try to construct a NSObject * const __strong [1] or
NSObject * const __strong [2]. However, in CGExpr.cpp
CGF::EmitMaterializeTemporaryExpr, we explicitly call EmitScalarInit, thus
ending up trying to emit an aggregate as a scalar. This triggers an assertion.
Handling that either by using EmitAggLValue or EmitAnyExprToMem (or better yet,
removing the special case), trigger a secondary assertion in
pushTemporaryCleanup which also seems bogus:
assert(!ObjCARCReferenceLifetimeType->isArrayType());</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>