Fix valid-for-expr ellipses eaten as invalid decl
authorHubert Tong <hubert.reinterpretcast@gmail.com>
Sat, 20 May 2017 00:21:55 +0000 (00:21 +0000)
committerHubert Tong <hubert.reinterpretcast@gmail.com>
Sat, 20 May 2017 00:21:55 +0000 (00:21 +0000)
commit605eacafa7540ae893e6083bc03387914d11e798
treed0a9bebcfb81a8a655c5ba5937a9ea028cc3cd5c
parente7cfcbd5dc9da3643a69548526d5955afc987a47
Fix valid-for-expr ellipses eaten as invalid decl

Summary:
The trial parse for declarative syntax accepts an invalid pack
declaration syntax, which is ambiguous with valid pack expansions of
expressions. This commit removes the invalid pack declaration syntax to
avoid mistaking valid pack expansions as invalid declarator components.

Additionally, the trial parse of a //template-argument-list// then needs
to handle the optional ellipsis that is part of that grammar, as opposed
to relying on the trial parse for declarators accepting stray ellipses.

Reviewers: rsmith, rcraik, aaron.ballman

Reviewed By: rsmith

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D33339

llvm-svn: 303472
clang/lib/Parse/ParseTentative.cpp
clang/test/Parser/cxx0x-ambig.cpp