[PATCH] D61396: [hip] Fix ambiguity from `>>>` of CUDA.

Michael Liao via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 7 17:52:11 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL360214: [hip] Fix ambiguity from `>>>` of CUDA. (authored by hliao, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D61396?vs=198545&id=198569#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D61396

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


Index: cfe/trunk/lib/Parse/ParseTentative.cpp
===================================================================
--- cfe/trunk/lib/Parse/ParseTentative.cpp
+++ cfe/trunk/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: cfe/trunk/test/Parser/cuda-kernel-call-c++11.cu
===================================================================
--- cfe/trunk/test/Parser/cuda-kernel-call-c++11.cu
+++ cfe/trunk/test/Parser/cuda-kernel-call-c++11.cu
@@ -3,6 +3,10 @@
 template<typename T=int> struct S {};
 template<typename> void f();
 
+template<typename T, typename... V> struct S<T(V...)> {};
+
+template<typename ...T> struct V {};
+template<typename ...T> struct V<void(T)...> {};
 
 void foo(void) {
   // In C++11 mode, all of these are expected to parse correctly, and the CUDA
@@ -21,4 +25,11 @@
 
   (void)(&f<S<S<int>>>==0);
   (void)(&f<S<S<>>>==0);
+
+  S<S<S<void()>>> s6;
+}
+
+template<typename ...T>
+void bar(T... args) {
+  S<S<V<void(T)...>>> s7;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61396.198569.patch
Type: text/x-patch
Size: 1596 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190508/8b703628/attachment.bin>


More information about the cfe-commits mailing list