summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/cxx11-initializer-array-new.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Quick-Fix pointer arithmetic when performing multi-D new-array initialization.Faisal Vali2013-12-141-2/+3
| | | | | | | | | | | | | | | | | | clang still doesn't emit the right llvm code when initializing multi-D arrays it seems. For e.g. the following code would still crash for me on Windows 7, 64 bit: auto f4 = new int[100][200][300]{{{1,2,3}, {4, 5, 6}}, {{10, 20, 30}}}; It seems that the final new loop that iterates through each outermost array and memsets it to zero gets confused with its final ptr arithmetic. This patch ensures that it converts the pointer to the allocated type (int [200][300]) before incrementing it (instead of using the base type: 'int'). Richard somewhat squeamishly approved the patch (as a quick fix to potentially make it into 3.4) - while exhorting for a more optimized fix in the future. http://llvm-reviews.chandlerc.com/D2398 Thanks Richard! llvm-svn: 197294
* When performing an array new of a multidimensional array with an initializerRichard Smith2013-12-111-0/+106
list, each element of the initializer list may provide more than one of the base elements of the array. Be sure to initialize the right type and bump the array pointer by the right amount. llvm-svn: 196995
OpenPOWER on IntegriCloud