]> granicus.if.org Git - clang/commitdiff
Make sure that we parse a '>>' that closes two template argument lists
authorDouglas Gregor <dgregor@apple.com>
Tue, 11 Jan 2011 00:45:18 +0000 (00:45 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 11 Jan 2011 00:45:18 +0000 (00:45 +0000)
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

lib/Parse/ParseTemplate.cpp
test/CXX/temp/temp.param/p15-cxx0x.cpp

index aeafba8990efae6ab87d0e0993a15608c3cddab5..93f5c9ba43d7a94defb6cce50ac343804e3cd70c 100644 (file)
@@ -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) {
index 0ce669979c11251d96bae04c5a986d5a37a1d38a..f4be5b960b6cffdf4548affcfe8bc4a787cc99f5 100644 (file)
@@ -20,3 +20,5 @@ void f(const X<int> x) {
   X<X<int>> *x1;
 }
 
+template<typename T = void> struct X1 { };
+X1<X1<>> x1a;