demangle_info (info)
{ }
+ /* Un-push a character into the lexer. This can only un-push the
+ previous character in the input string. */
+ void unpush (char c)
+ {
+ gdb_assert (lexptr[-1] == c);
+ --lexptr;
+ }
+
/* LEXPTR is the current pointer into our lex buffer. PREV_LEXPTR
is the start of the last token lexed, only used for diagnostics.
ERROR_LEXPTR is the first place an error occurred. GLOBAL_ERRMSG
unqualified_name: oper
| oper '<' template_params '>'
{ $$ = state->fill_comp (DEMANGLE_COMPONENT_TEMPLATE, $1, $3.comp); }
+ | oper '<' template_params RSH
+ {
+ $$ = state->fill_comp (DEMANGLE_COMPONENT_TEMPLATE, $1, $3.comp);
+ state->unpush ('>');
+ }
| '~' NAME
{ $$ = state->make_dtor (gnu_v3_complete_object_dtor, $2); }
;
/* DEMANGLE_COMPONENT_TEMPLATE_ARGLIST */
templ : NAME '<' template_params '>'
{ $$ = state->fill_comp (DEMANGLE_COMPONENT_TEMPLATE, $1, $3.comp); }
+ | NAME '<' template_params RSH
+ {
+ $$ = state->fill_comp (DEMANGLE_COMPONENT_TEMPLATE, $1, $3.comp);
+ state->unpush ('>');
+ }
;
template_params : template_arg
should_be_the_same ("something<void ()>", "something<void (void)>");
should_parse ("void whatever::operator<=><int, int>");
+
+ should_be_the_same ("Foozle<int>::fogey<Empty<int> > (Empty<int>)",
+ "Foozle<int>::fogey<Empty<int>> (Empty<int>)");
}
#endif
CHECK (language_cplus, "A::B::C()", "A::B::C");
CHECK (language_cplus, "A::B::C", "A::B::C");
+ CHECK (language_cplus, "Foozle<int>::fogey<Empty<int>> (Empty<int>)",
+ "Foozle<int>::fogey<Empty<int> >");
+
#undef CHECK
#undef CHECK_INCOMPL
}