summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Sema] Remove location from implicit capture init exprVedant Kumar2018-09-131-2/+2
| | | | | | | | | | | | | | | | | | A lambda's closure is initialized when the lambda is declared. For implicit captures, the initialization code emitted from EmitLambdaExpr references source locations *within the lambda body* in the function containing the lambda. This results in a poor debugging experience: we step to the line containing the lambda, then into lambda, out again, over and over, until every capture's field is initialized. To improve stepping behavior, assign the starting location of the lambda to expressions which initialize an implicit capture within it. rdar://39807527 Differential Revision: https://reviews.llvm.org/D50927 llvm-svn: 342194
* Require the type of a by-copy capture to be complete before creating its field.Douglas Gregor2013-12-181-0/+9
| | | | | | | | | | | | The problem here is more serious than the fix implies. Adding a field to a class updates the triviality bits for the class (among other things). Failing to require a complete type before adding the field meant that these updates don't happen in the well-formed case where the capture is an uninstantiated class template specialization, leading the lambda itself to be treated as having a trivial copy constructor when it shouldn't. Fixes <rdar://problem/15560464>. llvm-svn: 197623
* Diagnose by-copy captures of abstract classes.Douglas Gregor2013-10-111-0/+12
| | | | | | Fixes <rdar://problem/14468891>. llvm-svn: 192419
* When capturing 'this' in a lambda, make sure to update the set ofDouglas Gregor2012-10-251-0/+15
| | | | | | | array-index starting values for the 'this' capture. Fixes <rdar://problem/12426831>. llvm-svn: 166709
* A little more lambda capture initialization diagnostics cleanupDouglas Gregor2012-02-151-1/+8
| | | | llvm-svn: 150589
* Introduce a new initialization entity for lambda captures, andDouglas Gregor2012-02-151-3/+6
| | | | | | specialize location information and diagnostics for this entity. llvm-svn: 150588
* Make sure Sema creates a field for 'this' captures. (Doug, please ↵Eli Friedman2012-02-111-0/+8
| | | | | | double-check that this is correct.) llvm-svn: 150292
* Remove the "unsupported" error for lambda expressions. It's annoying,Douglas Gregor2012-02-091-7/+5
| | | | | | and rapidly becoming untrue. llvm-svn: 150165
* Implement capture-by-copy for arrays in lambdas.Douglas Gregor2012-02-091-3/+14
| | | | llvm-svn: 150138
* When we create a non-static data member in the closure object for aDouglas Gregor2012-02-091-0/+17
| | | | | | capture, make sure we actually add the field. llvm-svn: 150135
* Various interrelated cleanups for lambdas:Douglas Gregor2012-02-091-2/+18
| | | | | | | | | | | | | | - Complete the lambda class when we finish the lambda expression (previously, it was left in the "being completed" state) - Actually return the LambdaExpr object and bind to the resulting temporary when needed. - Detect when cleanups are needed while capturing a variable into a lambda (e.g., due to default arguments in the copy constructor), and make sure those cleanups apply for the whole of the lambda expression. llvm-svn: 150123
* Introduce basic ASTs for lambda expressions. This covers:Douglas Gregor2012-02-071-0/+15
- Capturing variables by-reference and by-copy within a lambda - The representation of lambda captures - The creation of the non-static data members in the lambda class that store the captured variables - The initialization of the non-static data members from the captured variables - Pretty-printing lambda expressions There are a number of FIXMEs, both explicit and implied, including: - Creating a field for a capture of 'this' - Improved diagnostics for initialization failures when capturing variables by copy - Dealing with temporaries created during said initialization - Template instantiation - AST (de-)serialization - Binding and returning the lambda expression; turning it into a proper temporary - Lots and lots of semantic constraints - Parameter pack captures llvm-svn: 149977
OpenPOWER on IntegriCloud