Page MenuHomePhabricator

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

Authored by faisalv on Dec 3 2014, 8:46 PM.

Details

Reviewers
faisalv
rsmith
Summary

See reddit post for some additional context: http://www.reddit.com/r/cpp/comments/2nkcvi/generic_lambda_inconsistency/

An ellipsis following an auto should always be parsed as a parameter pack, not as a c-variadic.

[](auto ...) { }();  // OK.

Diff Detail

Event Timeline

faisalv updated this revision to Diff 16907.Dec 3 2014, 8:46 PM
faisalv retitled this revision from to Fix PR21684 - Ellipsis at end of generic lambda parameter-declaration-clause should be parsed as a parameter pack.
faisalv updated this object.
faisalv edited the test plan for this revision. (Show Details)
faisalv added a reviewer: rsmith.
faisalv added a subscriber: Unknown Object (MLST).
rsmith added inline comments.Dec 3 2014, 9:22 PM
lib/Parse/ParseDecl.cpp
4882–4888

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.

faisalv accepted this revision.Dec 4 2014, 4:53 AM
faisalv added a reviewer: faisalv.

I had a sneaking suspicion the refactoring wouldn't fly - and while I find such singular uses of lambdas adding clarity when used judiciously - I can certainly appreciate your concerns here. Mostly, thanks for articulating your rationale! =)

Committed as r223357 (http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20141201/119491.html) per your preference.

Thanks!

This revision is now accepted and ready to land.Dec 4 2014, 4:53 AM