]> granicus.if.org Git - clang/commit
Make tentative parsing to detect template-argument-lists less aggressive
authorRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 15 May 2019 23:36:14 +0000 (23:36 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 15 May 2019 23:36:14 +0000 (23:36 +0000)
commitb04cabbff445e575f3e7bc9660df8247f7a7b844
treeca25ba9a30ec87ef11bdd95d3692d0c89cfaa861
parent4455ba48b7288f0399ff37a5038713bb9121df92
Make tentative parsing to detect template-argument-lists less aggressive
(and less wrong).

It's not correct to assume that X<something, Type> is always a
template-id; there are a few cases where the comma takes us into a
non-expression syntactic context in which 'Type' might be permissible.
Stop doing that.

This slightly regresses our error recovery on the cases where the
construct is intended to be a template-id. We typically do still manage
to diagnose a missing 'template' keyword, but we realize this too late
to properly recover from the error.

This fixes a regression introduced by r360308.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360827 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Parse/ParseTentative.cpp
test/Parser/cxx-template-argument.cpp
test/SemaTemplate/dependent-template-recover.cpp