diff --git a/clang/lib/Parse/ParseTentative.cpp b/clang/lib/Parse/ParseTentative.cpp --- a/clang/lib/Parse/ParseTentative.cpp +++ b/clang/lib/Parse/ParseTentative.cpp @@ -593,7 +593,8 @@ (Tok.is(tok::greatergreater) || (Tok.is(tok::ellipsis) && NextToken().isOneOf(tok::greater, tok::greatergreater, - tok::comma)))))) { + tok::comma)))) || + (getLangOpts().CUDA && Tok.is(tok::greatergreatergreater)))) { TPR = TPResult::True; isAmbiguous = true; diff --git a/clang/test/Parser/cuda-kernel-call-c++11.cu b/clang/test/Parser/cuda-kernel-call-c++11.cu --- a/clang/test/Parser/cuda-kernel-call-c++11.cu +++ b/clang/test/Parser/cuda-kernel-call-c++11.cu @@ -3,6 +3,8 @@ template struct S {}; template void f(); +template struct S {}; + void foo(void) { // In C++11 mode, all of these are expected to parse correctly, and the CUDA @@ -21,4 +23,6 @@ (void)(&f>>==0); (void)(&f>>==0); + + S>> s6; }