The template parsing code has special provision for encountering the '>>' token at the end of a template list for C++11. When the language is CUDA, '>>>' is lexed as a single token (tok::greatergreatergreater), and this should also be taken into account. The code in the template parser is already almost correct for handling this case. However, due to r209824 which masked CUDA in C++11 mode, we uncover a bug wherein the parsing actually fails for '-x cuda -std=c++11'.
See PR20081 for more details.