[PATCH] Fix PR21684 - Ellipsis at end of generic lambda parameter-declaration-clause should be parsed as a parameter pack

Richard Smith richard at metafoo.co.uk
Wed Dec 3 21:22:52 PST 2014


================
Comment at: lib/Parse/ParseDecl.cpp:4882-4888
@@ -4881,9 +4913,1 @@
-    //   as part of the parameter-declaration-clause.
-    if (Tok.is(tok::ellipsis) && D.getCXXScopeSpec().isEmpty() &&
-        !((D.getContext() == Declarator::PrototypeContext ||
-           D.getContext() == Declarator::LambdaExprParameterContext ||
-           D.getContext() == Declarator::BlockLiteralContext) &&
-          NextToken().is(tok::r_paren) &&
-          !D.hasGroupingParens() &&
-          !Actions.containsUnexpandedParameterPacks(D))) {
       SourceLocation EllipsisLoc = ConsumeToken();
----------------
Please keep this existing code structure and just add the check for 'auto' to the end, or factor out a meaningful part of this into a separate function. Adding a page full of semi-unrelated code into the middle of a function like this makes it harder to read, and the code communicates its intent well enough without the comments.

http://reviews.llvm.org/D6520






More information about the cfe-commits mailing list