From: Douglas Gregor Date: Tue, 11 Jan 2011 00:45:18 +0000 (+0000) Subject: Make sure that we parse a '>>' that closes two template argument lists X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4f3018eceac9cc32966e50ee900d8559efcaea21;p=clang Make sure that we parse a '>>' that closes two template argument lists appropritely when there are no other template arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123204 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Parse/ParseTemplate.cpp b/lib/Parse/ParseTemplate.cpp index aeafba8990..93f5c9ba43 100644 --- a/lib/Parse/ParseTemplate.cpp +++ b/lib/Parse/ParseTemplate.cpp @@ -677,7 +677,7 @@ Parser::ParseTemplateIdAfterTemplateName(TemplateTy Template, bool Invalid = false; { GreaterThanIsOperatorScope G(GreaterThanIsOperator, false); - if (Tok.isNot(tok::greater)) + if (Tok.isNot(tok::greater) && Tok.isNot(tok::greatergreater)) Invalid = ParseTemplateArgumentList(TemplateArgs); if (Invalid) { diff --git a/test/CXX/temp/temp.param/p15-cxx0x.cpp b/test/CXX/temp/temp.param/p15-cxx0x.cpp index 0ce669979c..f4be5b960b 100644 --- a/test/CXX/temp/temp.param/p15-cxx0x.cpp +++ b/test/CXX/temp/temp.param/p15-cxx0x.cpp @@ -20,3 +20,5 @@ void f(const X x) { X> *x1; } +template struct X1 { }; +X1> x1a;