Commit Graph

5 Commits

Author SHA1 Message Date
Richard Smith b26bc34e3a PR42587: diagnose unexpanded uses of a pack parameter of a generic
lambda from within the lambda-declarator.

Instead of trying to reconstruct whether a parameter pack was declared
inside a lambda (which we can't do correctly in general because we might
not have attached parameters to their declaration contexts yet), track
the set of parameter packs introduced in each live lambda scope, and
require only those parameters to be immediately expanded when they
appear inside that lambda.

In passing, fix incorrect disambiguation of a lambda-expression starting
with an init-capture pack in a braced-init-list. We previously
incorrectly parsed that as a designated initializer.

llvm-svn: 369985
2019-08-26 22:51:28 +00:00
Richard Smith fefdc9371b Revert "PR42587: diagnose unexpanded uses of a pack parameter of a generic" due to buildbot breakage.
This reverts commit r369722.

llvm-svn: 369725
2019-08-23 02:33:46 +00:00
Richard Smith 7fbadf3b27 PR42587: diagnose unexpanded uses of a pack parameter of a generic
lambda from within the lambda-declarator.

llvm-svn: 369722
2019-08-23 01:41:48 +00:00
Richard Smith 78a07ba438 PR33082: Improve tracking of unexpanded parameter packs within variadic generic lambdas.
llvm-svn: 310946
2017-08-15 19:11:21 +00:00
Faisal Vali 3628cb9cb6 Fix PR18498: Support explicit template arguments with variadic generic lambdas
http://llvm.org/bugs/show_bug.cgi?id=18498

This code was resulting in a crash:

auto L = [](auto ... v) { };
L.operator()<int>(3);

The reason is that the partially-substituted-pack is incorrectly retained within the current-instantiation-scope during template-argument-finalization, and because lambda's are local, there parent instantiation scopes are merged, which leads to the expansion-pattern being retained in the finalized specialization.

This patch ensures that once we have finalized deduction of a parameter-pack, we remove the partially-substituted-pack so that it doesn't cause CheckParameterPacksForExpansion to incorrectly inform the caller that it needs to retain the expansion pattern.


Thanks to Richard Smith for the review!

http://reviews.llvm.org/D2135

llvm-svn: 209992
2014-06-01 16:11:54 +00:00