rsmith requested changes to this revision. This revision now requires changes to proceed.
================ Comment at: lib/Parse/ParseTemplate.cpp:1233-1240 @@ -1240,1 +1232,10 @@ + + SuppressAllDiagnostics S(Diags); + GreaterThanIsOperatorScope G(GreaterThanIsOperator, false); + TemplateArgList TemplateArgs; + if (ParseTemplateArgumentList(TemplateArgs)) + return false; + + // Closing '>' + return Tok.is(tok::greater); } ---------------- This looks wrong: it will parse anything that could be a template argument list as a template argument list. In ambiguous cases, we must parse as a `<` operator. ================ Comment at: test/SemaTemplate/dependent-template-recover.cpp:14-15 @@ -13,5 +13,4 @@ - // FIXME: We can't recover from these yet - (*t).f2<N>(); // expected-error{{expected expression}} - (*t).f2<0>(); // expected-error{{expected expression}} + (*t).f2<N>(); // expected-error{{use 'template' keyword to treat 'f2' as a dependent template name}} + (*t).f2<0>(); // expected-error{{use 'template' keyword to treat 'f2' as a dependent template name}} } ---------------- I think you will incorrectly treat (*t).f2<0>(0); ... as a dependent template name. Instead, it's required to be parsed as ((*t.f2) < 0) > 0; ================ Comment at: test/SemaTemplate/dependent-template-recover.cpp:35 @@ +34,3 @@ + s.foo<1>(); // expected-error{{use 'template' keyword to treat 'foo' as a dependent template name}} + s.foo<1>(0); // expected-error{{use 'template' keyword to treat 'foo' as a dependent template name}} +} ---------------- This diagnostic is incorrect. http://reviews.llvm.org/D15509 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits