[cfe-commits] r123204 - in /cfe/trunk: lib/Parse/ParseTemplate.cpp test/CXX/temp/temp.param/p15-cxx0x.cpp

Douglas Gregor dgregor at apple.com
Mon Jan 10 16:45:18 PST 2011


Author: dgregor
Date: Mon Jan 10 18:45:18 2011
New Revision: 123204

URL: http://llvm.org/viewvc/llvm-project?rev=123204&view=rev
Log:
Make sure that we parse a '>>' that closes two template argument lists
appropritely when there are no other template arguments.



Modified:
    cfe/trunk/lib/Parse/ParseTemplate.cpp
    cfe/trunk/test/CXX/temp/temp.param/p15-cxx0x.cpp

Modified: cfe/trunk/lib/Parse/ParseTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseTemplate.cpp?rev=123204&r1=123203&r2=123204&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseTemplate.cpp (original)
+++ cfe/trunk/lib/Parse/ParseTemplate.cpp Mon Jan 10 18:45:18 2011
@@ -677,7 +677,7 @@
   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) {

Modified: cfe/trunk/test/CXX/temp/temp.param/p15-cxx0x.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.param/p15-cxx0x.cpp?rev=123204&r1=123203&r2=123204&view=diff
==============================================================================
--- cfe/trunk/test/CXX/temp/temp.param/p15-cxx0x.cpp (original)
+++ cfe/trunk/test/CXX/temp/temp.param/p15-cxx0x.cpp Mon Jan 10 18:45:18 2011
@@ -20,3 +20,5 @@
   X<X<int>> *x1;
 }
 
+template<typename T = void> struct X1 { };
+X1<X1<>> x1a;





More information about the cfe-commits mailing list