<div dir="ltr"><div>Hi All,<br>I am trying to resolve an assertion failure that occurs for following test code with latest llvm svn trunk code as well.<br><br>// PR c++/56772<br>// { dg-require-effective-target c++11 }<br>
<br>typedef __SIZE_TYPE__ size_t;<br>void* operator new[](size_t, void *p) { return p; }<br>//template <typename T = size_t><br>void f ()<br>{<br> size_t coord [3][3];<br> new (&coord) size_t [3][3]<br> {<br>
{0,0,0},<br> {0,0,0},<br> {0,0,0},<br> };<br>}<br><br>int main ()<br>{<br> //f<>(); <br> f();<br>}<br><br>It appears that storing subinitlist expressions is not taken care in EmitNewArrayInitializer<br>
</div><div>check this code :-<br>for (unsigned i = 0, e = ILE->getNumInits(); i != e; ++i) {<br> // Tell the cleanup that it needs to destroy up to this<br> // element. TODO: some of these stores can be trivially<br>
// observed to be unnecessary.<br> if (endOfInit) Builder.CreateStore(explicitPtr, endOfInit);<br> StoreAnyExprIntoOneUnit(*this, ILE->getInit(i), elementType, explicitPtr);<br> explicitPtr =Builder.CreateConstGEP1_32(explicitPtr, 1, "array.exp.next");<br>
}<br> <br></div><div>I had made a quick fix which was uploaded at <a href="http://llvm-reviews.chandlerc.com/D1986">http://llvm-reviews.chandlerc.com/D1986</a><br></div>It is not a final solution, but i am hoping it is the right direction.<br>
Could someone please provide me constructive inputs so that i know i am heading in right direction.<br><br>Many Thanks!<br>Jyoti Allur<br><div><br><br><br></div></div>