summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp
Commit message (Collapse)AuthorAgeFilesLines
* PR20445: Properly transform the initializer in a CXXNewExpr rather than runningRichard Smith2014-07-251-0/+10
| | | | | | | it through the normal TreeTransform logic for Exprs (which will strip off implicit parts of the initialization and never re-create them). llvm-svn: 213913
* Remove incorrect assertion.Richard Smith2014-06-031-0/+7
| | | | llvm-svn: 210092
* Implement DR990 and DR1070. Aggregate initialization initializes uninitializedRichard Smith2014-06-031-1/+18
| | | | | | | | | elements from {}, rather than value-initializing them. This permits calling an initializer-list constructor or constructing a std::initializer_list object. (It would also permit initializing a const reference or rvalue reference if that weren't explicitly prohibited by other rules.) llvm-svn: 210091
* AST: Update reference temporary manglingDavid Majnemer2014-05-061-9/+9
| | | | | | | | | | | | | | | Summary: Update our mangling to match the discussion on cxx-abi-dev. This involves using a seq-id instead of an optional number. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3631 llvm-svn: 208140
* CHECK-LABEL-ify some code gen tests to improve diagnostic experience when ↵Stephen Lin2013-08-151-20/+20
| | | | | | tests fail. llvm-svn: 188447
* Fix nested lifetime extension when a std::initializer_list member isRichard Smith2013-06-271-0/+36
| | | | | | initialized during aggregate initialization of the surrounding structure. llvm-svn: 185117
* Emit initializers for static-storage-duration temporaries as constants whereRichard Smith2013-06-141-5/+46
| | | | | | possible. llvm-svn: 183967
* Clean up test to appease NDEBUG builds.Richard Smith2013-06-131-6/+6
| | | | llvm-svn: 183924
* PR12086, PR15117Richard Smith2013-06-121-8/+74
| | | | | | | | | | | | | | | | | | | Introduce CXXStdInitializerListExpr node, representing the implicit construction of a std::initializer_list<T> object from its underlying array. The AST representation of such an expression goes from an InitListExpr with a flag set, to a CXXStdInitializerListExpr containing a MaterializeTemporaryExpr containing an InitListExpr (possibly wrapped in a CXXBindTemporaryExpr). This more detailed representation has several advantages, the most important of which is that the new MaterializeTemporaryExpr allows us to directly model lifetime extension of the underlying temporary array. Using that, this patch *drastically* simplifies the IR generation of this construct, provides IR generation support for nested global initializer_list objects, fixes several bugs where the destructors for the underlying array would accidentally not get invoked, and provides constant expression evaluation support for std::initializer_list objects. llvm-svn: 183872
* Model temporary lifetime-extension explicitly in the AST. Use this model toRichard Smith2013-06-051-0/+3
| | | | | | | | | handle temporaries which have been lifetime-extended to static storage duration within constant expressions. This correctly handles nested lifetime extension (through reference members of aggregates in aggregate initializers) but non-constant-expression emission hasn't yet been updated to do the same. llvm-svn: 183283
* Fix assert on temporary std::initializer_list.Richard Smith2013-05-231-0/+10
| | | | llvm-svn: 182615
* CodeGen support for function-local static thread_local variables withRichard Smith2013-04-141-0/+6
| | | | | | | | | non-constant constructors or non-trivial destructors. Plus bugfixes for thread_local references bound to temporaries (the temporaries themselves are lifetime-extended to become thread_local), and the corresponding case for std::initializer_list. llvm-svn: 179496
* <rdar://problem/13325066> Destroy std::initializer_list temporaries whose ↵Douglas Gregor2013-04-061-0/+19
| | | | | | lifetime has been extended by reference binding. llvm-svn: 178939
* Provide fixed target triples to make test results consistent across ARM hosts.David Blaikie2012-09-101-1/+1
| | | | | | Patch by David Tweed, review by myself and John McCall. llvm-svn: 163564
* If the element type of an initializer list has a destructor, make sure we ↵Sebastian Redl2012-03-051-0/+18
| | | | | | check it. Fixes PR12178. llvm-svn: 152048
* CodeGen support for global variables of type std::initializer_list<X>.Sebastian Redl2012-02-251-15/+32
| | | | | | | | | | | | | This emits a backing array with internal linkage and fills it with data, then has the initializer_list point at the array. Dynamic initialization and global destructors are correctly supported. What doesn't work is nested initializer_lists. I have no idea how to get them to work, either. However, these should be very rare, and so I'll just call it a known bug and declare generalized initializers DONE! llvm-svn: 151457
* Harden test against for operator new(unsigned int).Benjamin Kramer2012-02-191-1/+1
| | | | llvm-svn: 150932
* Make heap-allocation of std::initializer_list 'work'.Sebastian Redl2012-02-191-0/+20
| | | | llvm-svn: 150931
* Make std::initializer_list member initializers 'work'.Sebastian Redl2012-02-191-0/+31
| | | | llvm-svn: 150930
* Get recursive initializer lists to work and add a test. Codegen of ↵Sebastian Redl2012-02-191-0/+28
| | | | | | std::initializer_list is now complete. Onward to array new. llvm-svn: 150926
* Add a testcase for using objects with list-constructors, and fix a Sema ↵Sebastian Redl2012-02-191-1/+29
| | | | | | crash by repeating an old hack. llvm-svn: 150925
* Add a testcase to show that temporaries from the initializer list are ↵Sebastian Redl2012-02-191-0/+30
| | | | | | destroyed correctly. llvm-svn: 150924
* Basic code generation support for std::initializer_list.Sebastian Redl2012-02-171-0/+80
We now generate temporary arrays to back std::initializer_list objects initialized with braces. The initializer_list is then made to point at the array. We support both ptr+size and start+end forms, although the latter is untested. Array lifetime is correct for temporary std::initializer_lists (e.g. call arguments) and local variables. It is untested for new expressions and member initializers. Things left to do: Massively increase the amount of testing. I need to write tests for start+end init lists, temporary objects created as a side effect of initializing init list objects, new expressions, member initialization, creation of temporary objects (e.g. std::vector) for initializer lists, and probably more. Get lifetime "right" for member initializers and new expressions. Not that either are very useful. Implement list-initialization of array new expressions. llvm-svn: 150803
OpenPOWER on IntegriCloud