Commit 4d457401 authored by Roberto Raggi's avatar Roberto Raggi Committed by Erik Verbruggen
Browse files

Fixed parsing of anonymous template parameters.

For example,
  template <template <typename> class X> struct foo {};

Reviewed-by: erikv
parent bf518ba8
......@@ -1577,13 +1577,22 @@ bool Parser::parseTemplateTypeParameter(DeclarationAST *&node)
bool Parser::lookAtTypeParameter() const
{
if ((LA() == T_CLASS || LA() == T_TYPENAME) && LA(2) == T_IDENTIFIER) {
switch (LA(3)) {
case T_EQUAL:
case T_COMMA:
case T_GREATER:
return true;
if (LA() == T_CLASS || LA() == T_TYPENAME) {
if (LA(2) == T_IDENTIFIER) {
switch (LA(3)) {
case T_EQUAL:
case T_COMMA:
case T_GREATER:
return true;
default:
return false;
}
}
// recognized an anonymous template type parameter. e.g
// template <typename>
return true;
}
return false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment