]> granicus.if.org Git - clang/commit
PR42587: diagnose unexpanded uses of a pack parameter of a generic
authorRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 26 Aug 2019 22:51:28 +0000 (22:51 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 26 Aug 2019 22:51:28 +0000 (22:51 +0000)
commitd814f930835df25d66f9f4b22fd7762f89ad89a4
tree21701f0e8d485fdfbe9ec7bdedd463b69c589035
parent4ea481ed968c192a0df8a58dc02b9ec6eb591f07
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@369985 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Sema/ScopeInfo.h
include/clang/Sema/Sema.h
lib/Parse/ParseInit.cpp
lib/Sema/Sema.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaLambda.cpp
lib/Sema/SemaTemplate.cpp
lib/Sema/SemaTemplateVariadic.cpp
test/SemaCXX/cxx1y-generic-lambdas-variadics.cpp