From beda951d788a0041e9f5fabbb4e018e8b9d0a2d3 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 15 May 2019 23:36:14 +0000 Subject: Make tentative parsing to detect template-argument-lists less aggressive (and less wrong). It's not correct to assume that X 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. llvm-svn: 360827 --- clang/test/Parser/cxx-template-argument.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'clang/test/Parser') diff --git a/clang/test/Parser/cxx-template-argument.cpp b/clang/test/Parser/cxx-template-argument.cpp index b3a9071785b..70945e3aa74 100644 --- a/clang/test/Parser/cxx-template-argument.cpp +++ b/clang/test/Parser/cxx-template-argument.cpp @@ -127,3 +127,14 @@ namespace PR18793 { template struct S {}; template int g(S *); } + +namespace r360308_regression { + template struct S1 { static int const n = 0; }; + template struct S2 { typedef int t; }; + template struct S3 { typename S2::n < 0, int>::t n; }; + + template bool f(FT p) { + const bool a = p.firstFT(0); + return a == b; + } +} -- cgit v1.2.3