}
}
- if (Tok.isNot(tok::greater) && Tok.isNot(tok::greatergreater))
+ if (Tok.isNot(tok::greater) && Tok.isNot(tok::greatergreater)) {
+ Diag(Tok.getLocation(), diag::err_expected_greater);
return true;
+ }
// Determine the location of the '>' or '>>'. Only consume this
// token if the caller asked us to.
ConsumeToken();
}
- return Tok.isNot(tok::greater) && Tok.isNot(tok::greatergreater);
+ return false;
}
/// \brief Parse a C++ explicit template instantiation
--- /dev/null
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+template<typename T> struct A {};
+
+// Check for template argument lists followed by junk
+// FIXME: The diagnostics here aren't great...
+A<int+> int x; // expected-error {{expected '>'}} expected-error {{expected unqualified-id}}
+A<int x; // expected-error {{expected '>'}} expected-error {{C++ requires a type specifier for all declarations}}
+