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 struct S {}; template void f(); +template struct S {}; + +template struct V {}; +template struct V {}; void foo(void) { // In C++11 mode, all of these are expected to parse correctly, and the CUDA @@ -21,4 +25,11 @@ (void)(&f>>==0); (void)(&f>>==0); + + S>> s6; +} + +template +void bar(T... args) { + S>> s7; }