History log of /external/clang/test/SemaCXX/lambda-expressions.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
/external/clang/test/SemaCXX/lambda-expressions.cpp
de8eaa2bf22ab0a59118289ee8b97f6ac6a97196 01-Oct-2013 Faisal Vali <faisalv@yahoo.com> Fix computation of linkage within nested lambdas.

When nested C++11 lambdas are used in NSDMI's - this patch prevents infinite recursion by computing the linkage of any nested lambda by determining the linkage of the outermost enclosing lambda (which might inherit its linkage from its parent).

See http://llvm-reviews.chandlerc.com/D1783 for Doug's approval.

[On a related note, I need this patch so as to pass tests of transformations of nested lambdas returned from member functions]


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191727 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
c6867ddf541925c4dede00295fa2d06e8a39e89c 29-Sep-2013 Faisal Vali <faisalv@yahoo.com> Revert the linkage fix.
I got a bunch of buildbot failures that i don't understand - sorry.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191647 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
99229cd81825a9c1df20ed8971d10608e5793521 29-Sep-2013 Faisal Vali <faisalv@yahoo.com> Fix computation of linkage within nested lambdas.
When nested lambdas are used in NSDMI's - this prevents infinite recursion.

See http://llvm-reviews.chandlerc.com/D1783 for Doug's approval regarding the code, and then request for some tests.

[On a related note, I need this patch so as to pass tests of transformations of nested lambdas returned from member functions]


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191645 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
14d937afc2ad8f65dccbafeb62271e80dbd46a78 27-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> Handle a difference in lambda return type deduction between C++11 and C++1y: if
no return type is specified, C++11 will deduce a cv-qualified return type in
some cases, but C++1y never will.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187275 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
ec0808decc682f76e411eed7206a82a34b87dd7d 27-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR16708: If a lambda has an implicit return type, don't get confused if its return type has already been determined to be a type containing an 'auto'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187266 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
f050d2445ed75569ccfe0740caa900403d2ce3b3 13-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement core issue 903: only integer literals with value 0 and prvalues of
type std::nullptr_t are null pointer constants from C++11 onwards.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183883 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
42427409fd75a48381071e6da008a3c06897437a 06-Dec-2012 Benjamin Kramer <benny.kra@googlemail.com> Sema: Don't emit a warning when __func__ is used in a lambda outside of a function.

Fixes PR14518.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169510 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
9dd686d2be3c3785a089ff12a3d3eb64e9b32dc0 24-Oct-2012 Eli Friedman <eli.friedman@gmail.com> Update regression tests for r166617.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166619 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
5016a70c183a50845a0421802d161093dd0643f6 20-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> DR1472: A reference isn't odr-used if it has preceding initialization,
initialized by a reference constant expression.

Our odr-use modeling still needs work here: we don't yet implement the 'set of
potential results of an expression' DR.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166361 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
7c3c6bca2662704fbe038137d8ef2e4112359586 20-Sep-2012 Eli Friedman <eli.friedman@gmail.com> Handle lambdas where the lambda-declarator is an explicit "(void)". PR13854.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164274 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
9cd5b24315aea4bc58bac03cfb4874e076b013b8 18-Sep-2012 Eli Friedman <eli.friedman@gmail.com> Add an extra check for invalid decls in the lambda semantic analysis to avoid a crash. PR13860.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164168 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
50800fc551ac6b8a95cca662223e7f061bbd169a 08-Aug-2012 David Blaikie <dblaikie@gmail.com> Implement warning for integral null pointer constants other than the literal 0.

This is effectively a warning for code that violates core issue 903 & thus will
become standard error in the future, hopefully. It catches strange null
pointers such as: '\0', 1 - 1, const int null = 0; etc...

There's currently a flaw in this warning (& the warning for 'false' as a null
pointer literal as well) where it doesn't trigger on comparisons (ptr == '\0'
for example). Fix to come in a future patch.

Also, due to this only being a warning, not an error, it triggers quite
frequently on gtest code which tests expressions for null-pointer-ness in a
SFINAE context (so it wouldn't be a problem if this was an error as in an
actual implementation of core issue 903). To workaround this for now, the
diagnostic does not fire in unevaluated contexts.

Review by Sean Silva and Richard Smith.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161501 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
612409ece080e814f79e06772c690d603f45fbd6 25-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR12057: Allow variadic template pack expansions to cross lambda boundaries.
Rather than adding a ContainsUnexpandedParameterPack bit to essentially every
AST node, we tunnel the bit directly up to the surrounding lambda expression
when we reach a context where an unexpanded pack can not normally appear.
Thus any statement or declaration within a lambda can now potentially contain
an unexpanded parameter pack.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160705 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
287698336ff9f9315bf814943068d6b8261e517d 04-Jun-2012 Aaron Ballman <aaron@aaronballman.com> Fixes some test cases that should have come along with r157943.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157947 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
23dde82d9043d404ee506880796b761bfec93d0d 13-Mar-2012 John McCall <rjmccall@apple.com> Make the error about assigning to lambda-captured variables
clearer, and mention the existence of mutable lambdas.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152598 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
78dae24600a877f52dbb6e58bfd5778754a00974 13-Mar-2012 John McCall <rjmccall@apple.com> Alternate fix to PR12248: put Sema in charge of special-casing
the diagnostic for assigning to a copied block capture. This has
the pleasant side-effect of letting us special-case the diagnostic
for assigning to a copied lambda capture as well, without introducing
a new non-modifiable enumerator for it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152593 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
71930e02730f3afecd6e71e4d6831b4a07436a7f 12-Mar-2012 Eli Friedman <eli.friedman@gmail.com> Make sure we treat variables captured by reference in lambda as modifiable lvalues. Regression from r152491. Fixes PR12248.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152573 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
16581335fc32abcbc6ab14eda7af38cf759664b7 02-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Ensure that we instantiate static reference data members of class templates
early, since their values can be used in constant expressions in C++11. For
odr-use checking, the opposite change is required, since references are
odr-used whether or not they satisfy the requirements for appearing in a
constant expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151881 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
61dab36ccbcc1eef7b7cfcb641e04116726ad053 25-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Remove FIXME: as Eli points out, the behavior here is now correct.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151405 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
359c89df5479810c9d4784fc0b6ab592eb136777 24-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> When checking whether a reference to a variable is an ICE, look at the type of
the declaration, not at the type of the DeclRefExpr, since within a lambda the
DeclRefExpr can be more const than the declaration is.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151399 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
b09ab8c293833c3dbcbf78f0db5e01fec46966bf 21-Feb-2012 Douglas Gregor <dgregor@apple.com> Only pop the expression evaluation context corresponding to a lambda
expression after we've finished the function body of the corresponding
function call operator. Otherwise, ActOnFinishFunctionBody() will see
the (unfinished) evaluation context of the lambda expression
itself. Fixes PR12031.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151082 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
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/SemaCXX/lambda-expressions.cpp
f8af98286022f72157d84951b48fde5fb369ab29 12-Feb-2012 Douglas Gregor <dgregor@apple.com> Within the body of a lambda expression, decltype((x)) for an
id-expression 'x' will compute the type based on the assumption that
'x' will be captured, even if it isn't captured, per C++11
[expr.prim.lambda]p18. There are two related refactors that go into
implementing this:

1) Split out the check that determines whether we should capture a
particular variable reference, along with the computation of the
type of the field, from the actual act of capturing the
variable.
2) Always compute the result of decltype() within Sema, rather than
AST, because the decltype() computation is now context-sensitive.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150347 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
54042f1bd78f1f1ea86be7d4af541462e127d2ed 09-Feb-2012 Douglas Gregor <dgregor@apple.com> Implement return type deduction for lambdas per C++11
[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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150168 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
b326ca8ffbea96f9cc8a457b0f57be880304a6f5 09-Feb-2012 Douglas Gregor <dgregor@apple.com> Remove the "unsupported" error for lambda expressions. It's annoying,
and rapidly becoming untrue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150165 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
503384f731b5abcbf870b0a5224eb920e631db0a 09-Feb-2012 Douglas Gregor <dgregor@apple.com> Various interrelated cleanups for lambdas:
- 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150123 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
210386eb619ea9feef425636150bdffc0538574d 06-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Fix the result of VarDecl::checkInitIsICE so it is consistently accurate in C++11 mode. PR11928.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149908 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
cefc7b20fdb97b989163199e0849b4325e9b7804 04-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Make explicit captures which cause implicit captures work correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149719 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
b942cb24a060435b18fef5b43eb33d77afc0d03a 03-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Implement implicit capture for lambda expressions.

Still left: explicit captures in lambdas need to cause implicit capture, and I need to take a look at the diagnostics for some cases.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149718 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
a1f2114d9e81923c750f6b439302ac03552c37db 01-Feb-2012 Douglas Gregor <dgregor@apple.com> Introduce the lambda scope before determining explicit captures, which
cleans up and improves a few things:
- We get rid of the ugly dance of computing all of the captures in
data structures that clone those of CapturingScopeInfo, centralizing
the logic for accessing/updating these data structures
- We re-use the existing capture logic for 'this', which actually
works now.

Cleaned up some diagnostic wording in minor ways as well.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149516 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
93962e5360a43200faa70939571afc4fb9326cf7 01-Feb-2012 Douglas Gregor <dgregor@apple.com> Improve checking of explicit captures in a C++11 lambda expression:
- 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149462 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
e41b0412b0b974b5d239b2f5ff8427ea0d128ec3 26-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Add an additional testcase for a lambda with implicit void return type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149034 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
84b007fae6c0cd30fa07074d34fbe2bf61fa44f9 26-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Refactor to share code for handling return statements between lambda expressions and block literals. As it turns out, almost all the logic can be shared.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149031 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
72899c34e3d1abfffa241ad0ce5c4bf175e5ea51 07-Jan-2012 Eli Friedman <eli.friedman@gmail.com> More lambda work: semantic analysis of capturing 'this'. It's a bit complicated, but we have to be careful about when exactly captures are marked given PotentiallyPotentiallyEvaluated contexts. (Actually, it's not 100% correct yet, but it's close enough for the moment.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147723 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp
e81d7e9810eed0d805263791d761ec545d2cf779 07-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Lambdas: semantic analysis of explicit captures.

This patch (and some of my other commits related to lambdas) is heavily based off of John Freeman's work-in-progress patches.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147706 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/lambda-expressions.cpp