[LLVMbugs] [Bug 23932] New: Assertion failed: ((!Initializer || isa<ImplicitValueInitExpr>(Initializer) || isa<CXXConstructExpr>(Initializer)) && "Initializer expression that cannot have been implicitly created."), function BuildCXXNew
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Tue Jun 23 16:53:09 PDT 2015
https://llvm.org/bugs/show_bug.cgi?id=23932
Bug ID: 23932
Summary: Assertion failed: ((!Initializer ||
isa<ImplicitValueInitExpr>(Initializer) ||
isa<CXXConstructExpr>(Initializer)) && "Initializer
expression that cannot have been implicitly
created."), function BuildCXXNew
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Frontend
Assignee: unassignedclangbugs at nondot.org
Reporter: compnerd at compnerd.org
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
Reduced test case:
// %clang_cc1 -emit-obj -fobjc-arc -Os -x objective-c++ %s
// REQUIRES: asserts
template <typename T> const id *f() { return new id; }
auto i = f<int>();
// template <typename T> const id *f() { new id[32]; return nullptr; }
With ARC, id needs to be value initialized. The TreeTransform over the
template specialization will transform the ImplicitValueInitExpr into a
ParenListExpr, which breaks the initialization type check in BuildCXXNew.
The commented out test case is relevant as the single id case can be handled by
adding parenthesis to avoid setup the DirectInitRange value, while the same
workaround cannot be applied to the second case.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150623/7a39f32e/attachment.html>
More information about the llvm-bugs
mailing list