[PATCH] D61396: [hip] Fix ambiguity from `>>>` of CUDA.
Michael Liao via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue May 7 14:21:01 PDT 2019
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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61396.198529.patch
Type: text/x-patch
Size: 1402 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190507/42687826/attachment-0001.bin>
More information about the cfe-commits
mailing list