History log of /external/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
999713eea940f4e087cc3ac878689c5c5c7a7225 18-Feb-2012 Douglas Gregor <dgregor@apple.com> Rewrite variable capture within lambda expressions and blocks,
eliminating a bunch of redundant code and properly modeling how the
captures of outside blocks/lambdas affect the types seen by inner
captures.

This new scheme makes two passes over the capturing scope stack. The
first pass goes up the stack (from innermost to outermost), assessing
whether the capture looks feasible and stopping when it either hits
the scope where the variable is declared or when it finds an existing
capture. The second pass then walks down the stack (from outermost to
innermost), capturing the variable at each step and updating the
captured type and the type that an expression referring to that
captured variable would see. It also checks type-specific
restrictions, such as the inability to capture an array within a
block. Note that only the first odr-use of each
variable needs to do the full walk; subsequent uses will find the
capture immediately, so multiple walks need not occur.

The same routine that builds the captures can also compute the type of
the captures without signaling errors and without actually performing
the capture. This functionality is used to determine the type of
declaration references as well as implementing the weird decltype((x))
rule within lambda expressions.

The capture code now explicitly takes sides in the debate over C++
core issue 1249, which concerns the type of captures within nested
lambdas. We opt to use the more permissive, more useful definition
implemented by GCC rather than the one implemented by EDG.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150875 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp
68932845a432d2a1dbbc57a84fd85bbb37c90487 18-Feb-2012 Douglas Gregor <dgregor@apple.com> Unify our computation of the type of a captured reference to a
variable; it was previously duplicated, and one of the copies failed
to account for outer non-mutable lambda captures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150872 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp
8e9314fd846936ce04b92b2b72c6aba2cffab916 11-Feb-2012 Douglas Gregor <dgregor@apple.com> Add simple semantic test for C++11 [expr.prim.lambda]p16, which covers recursive capture. This is far more interesting for IRgen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150283 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp