summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/expr/expr.prim/expr.prim.lambda
Commit message (Collapse)AuthorAgeFilesLines
...
* Lambdas have a deleted default constructor and a deleted copyDouglas Gregor2012-02-124-0/+46
| | | | | | assignment operator, per C++ [expr.prim.lambda]p19. Make it so. llvm-svn: 150345
* 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
* Add simple semantic test for C++11 [expr.prim.lambda]p16, which covers ↵Douglas Gregor2012-02-101-0/+16
| | | | | | recursive capture. This is far more interesting for IRgen. llvm-svn: 150283
* Implement C++11 [expr.lambda.prim]p13, which prohibits lambdas inDouglas Gregor2012-02-101-0/+10
| | | | | | default arguments if in fact those lambdas capture any entity. llvm-svn: 150282
* Allow implicit capture of 'this' in a lambda even when the captureDouglas Gregor2012-02-101-3/+7
| | | | | | | | | | | | default is '=', and reword the warning about explicitly capturing 'this' in such lambdas to indicate that only explicit capture is banned. Introduce Fix-Its for this and other "save the programmer from themself" rules regarding what can be explicitly captured and what must be implicitly captured. llvm-svn: 150256
* Add test from [expr.prim.lambda]p12, which deals with odr-use andDouglas Gregor2012-02-101-0/+30
| | | | | | | | nested captures. We currently don't get odr-use correct in array bounds, so that bit is commented out while we sort out what we need to do. llvm-svn: 150255
* Don't introduce a lambda's operator() into the class until after weDouglas Gregor2012-02-101-0/+9
| | | | | | | | have finished parsing the body, so that name lookup will never find anything within the closure type. Then, add this operator() and the conversion function (if available) before completing the class. llvm-svn: 150252
* Add a lambda example from the working draft.Douglas Gregor2012-02-101-0/+9
| | | | llvm-svn: 150239
* Add various tests for captures and the reaching scope of the lambdaDouglas Gregor2012-02-103-0/+79
| | | | | | | expression. Implement C++11 [expr.prim.lambda]p12's requirement that capturing a variable will odr-use it. llvm-svn: 150237
* Implement the conversion to a function pointer for lambda expressions,Douglas Gregor2012-02-102-3/+25
| | | | | | per C++ [expr.prim.lambda]p6. llvm-svn: 150236
* Don't allow deduction of a lambda result type from an initializerDouglas Gregor2012-02-091-0/+1
| | | | | | list; it is not an expression. llvm-svn: 150194
* Tests for C++ [expr.prim.lambda]p5. We already implement all of theseDouglas Gregor2012-02-091-3/+57
| | | | | | semantics. llvm-svn: 150190
* Implement return type deduction for lambdas per C++11Douglas Gregor2012-02-091-0/+42
| | | | | | | | | [expr.prim.lambda]p4, including the current suggested resolution of core isue 975, which allows multiple return statements so long as the types match. ExtWarn when user code is actually making use of this extension. llvm-svn: 150168
* Remove the "unsupported" error for lambda expressions. It's annoying,Douglas Gregor2012-02-099-52/+38
| | | | | | and rapidly becoming untrue. llvm-svn: 150165
* Add a test for the non-aggregaticity of lambda types per C++11Douglas Gregor2012-02-091-0/+7
| | | | | | [expr.prim.lambda]. llvm-svn: 150164
* Implement C++ [expr.prim.lambda]p2, which bans lambda expressions inDouglas Gregor2012-02-091-0/+48
| | | | | | | unevaluated operands. Be certain that we're marking everything referenced within a capture initializer as odr-used. llvm-svn: 150163
* Implement capture-by-copy for arrays in lambdas.Douglas Gregor2012-02-092-3/+16
| | | | 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-096-25/+43
| | | | | | | | | | | | | | - 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
* Minor comment fixDouglas Gregor2012-02-081-1/+2
| | | | llvm-svn: 150090
* When computing the type of a local variable reference within a lambda,Douglas Gregor2012-02-081-2/+35
| | | | | | | | only add 'const' for variables captured by copy in potentially evaluated expressions of non-mutable lambdas. (The "by copy" part was missing). llvm-svn: 150088
* When completing a lambda expression, make sure to check and attach theDouglas Gregor2012-02-082-2/+14
| | | | | | body of the lambda to the function call operator. llvm-svn: 150087
* Introduce basic ASTs for lambda expressions. This covers:Douglas Gregor2012-02-072-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | - 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
* Implement implicit capture for lambda expressions.Eli Friedman2012-02-031-2/+1
| | | | | | Still left: explicit captures in lambdas need to cause implicit capture, and I need to take a look at the diagnostics for some cases. llvm-svn: 149718
* Diagnose the restriction on default arguments in C++11 [expr.prim.lambda]p5.Douglas Gregor2012-02-011-0/+7
| | | | llvm-svn: 149517
* Improve checking of explicit captures in a C++11 lambda expression:Douglas Gregor2012-02-012-0/+40
| | | | | | | | | | | | | | - Actually building the var -> capture mapping properly (there was an off-by-one error) - Keeping track of the source location of each capture - Minor QoI improvements, e.g, highlighing the prior capture if there are multiple captures, pointing at the variable declaration we found if we reject it. As part of this, add standard citations for the various semantic checks we perform, and note where we're not performing those checks as we should. llvm-svn: 149462
* Diagnose attempts to explicitly capture a __block variable in a lambda.Douglas Gregor2012-02-011-0/+11
llvm-svn: 149458
OpenPOWER on IntegriCloud