hliao updated this revision to Diff 198529.
hliao added a comment.

revise following reviewer's suggestion.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61396/new/

https://reviews.llvm.org/D61396

Files:
  clang/lib/Parse/ParseTentative.cpp
  clang/test/Parser/cuda-kernel-call-c++11.cu


Index: clang/test/Parser/cuda-kernel-call-c++11.cu
===================================================================
--- clang/test/Parser/cuda-kernel-call-c++11.cu
+++ clang/test/Parser/cuda-kernel-call-c++11.cu
@@ -3,6 +3,8 @@
 template<typename T=int> struct S {};
 template<typename> void f();
 
+template<typename T, typename... V> struct S<T(V...)> {};
+
 
 void foo(void) {
   // In C++11 mode, all of these are expected to parse correctly, and the CUDA
@@ -21,4 +23,6 @@
 
   (void)(&f<S<S<int>>>==0);
   (void)(&f<S<S<>>>==0);
+
+  S<S<S<void()>>> s6;
 }
Index: clang/lib/Parse/ParseTentative.cpp
===================================================================
--- clang/lib/Parse/ParseTentative.cpp
+++ clang/lib/Parse/ParseTentative.cpp
@@ -590,9 +590,11 @@
     } else if (Context == TypeIdAsTemplateArgument &&
                (Tok.isOneOf(tok::greater, tok::comma) ||
                 (getLangOpts().CPlusPlus11 &&
-                 (Tok.is(tok::greatergreater) ||
+                 (Tok.isOneOf(tok::greatergreater,
+                              tok::greatergreatergreater) ||
                   (Tok.is(tok::ellipsis) &&
                    NextToken().isOneOf(tok::greater, tok::greatergreater,
+                                       tok::greatergreatergreater,
                                        tok::comma)))))) {
       TPR = TPResult::True;
       isAmbiguous = true;


Index: clang/test/Parser/cuda-kernel-call-c++11.cu
===================================================================
--- clang/test/Parser/cuda-kernel-call-c++11.cu
+++ clang/test/Parser/cuda-kernel-call-c++11.cu
@@ -3,6 +3,8 @@
 template<typename T=int> struct S {};
 template<typename> void f();
 
+template<typename T, typename... V> struct S<T(V...)> {};
+
 
 void foo(void) {
   // In C++11 mode, all of these are expected to parse correctly, and the CUDA
@@ -21,4 +23,6 @@
 
   (void)(&f<S<S<int>>>==0);
   (void)(&f<S<S<>>>==0);
+
+  S<S<S<void()>>> s6;
 }
Index: clang/lib/Parse/ParseTentative.cpp
===================================================================
--- clang/lib/Parse/ParseTentative.cpp
+++ clang/lib/Parse/ParseTentative.cpp
@@ -590,9 +590,11 @@
     } else if (Context == TypeIdAsTemplateArgument &&
                (Tok.isOneOf(tok::greater, tok::comma) ||
                 (getLangOpts().CPlusPlus11 &&
-                 (Tok.is(tok::greatergreater) ||
+                 (Tok.isOneOf(tok::greatergreater,
+                              tok::greatergreatergreater) ||
                   (Tok.is(tok::ellipsis) &&
                    NextToken().isOneOf(tok::greater, tok::greatergreater,
+                                       tok::greatergreatergreater,
                                        tok::comma)))))) {
       TPR = TPResult::True;
       isAmbiguous = true;
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to