Index: lib/Parse/ParseTemplate.cpp =================================================================== --- lib/Parse/ParseTemplate.cpp +++ lib/Parse/ParseTemplate.cpp @@ -946,7 +946,9 @@ bool Invalid = false; { GreaterThanIsOperatorScope G(GreaterThanIsOperator, false); - if (Tok.isNot(tok::greater) && Tok.isNot(tok::greatergreater)) + if (!Tok.isOneOf(tok::greater, tok::greatergreater, + tok::greatergreatergreater, tok::greaterequal, + tok::greatergreaterequal)) Invalid = ParseTemplateArgumentList(TemplateArgs); if (Invalid) { Index: test/Parser/cuda-kernel-call-c++11.cu =================================================================== --- test/Parser/cuda-kernel-call-c++11.cu +++ test/Parser/cuda-kernel-call-c++11.cu @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s -template struct S {}; +template struct S {}; template void f(); @@ -11,10 +11,14 @@ // expected-no-diagnostics S>> s3; + S>> s30; S>>> s4; + S>>> s40; S>>>> s5; + S>>>> s50; (void)(&f>>==0); + (void)(&f>>==0); } Index: test/Parser/cuda-kernel-call.cu =================================================================== --- test/Parser/cuda-kernel-call.cu +++ test/Parser/cuda-kernel-call.cu @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s -template struct S {}; +template struct S {}; template void f(); void foo(void) { @@ -13,5 +13,7 @@ // The following two are parse errors because -std=c++11 is not enabled. S>> s; // expected-error 2{{use '> >'}} + S>> s1; // expected-error 2{{use '> >'}} (void)(&f>>==0); // expected-error 2{{use '> >'}} + (void)(&f>>==0); // expected-error 2{{use '> >'}} }