Workaround token issue in unnamed variadic template parameter
This commit is contained in:
parent
365677b2c9
commit
133d51b630
2 changed files with 16 additions and 2 deletions
|
|
@ -166,6 +166,18 @@ namespace
|
|||
// now we found the proper end of the token
|
||||
end = get_next_location(tu, file, next, -1);
|
||||
}
|
||||
else if ((kind == CXCursor_TemplateTypeParameter
|
||||
|| kind == CXCursor_NonTypeTemplateParameter
|
||||
|| kind == CXCursor_TemplateTemplateParameter)
|
||||
&& token_after_is(tu, file, cur, end, "..."))
|
||||
{
|
||||
// variadic tokens in unnamed parameter not included
|
||||
end = get_next_location(tu, file, end, 3);
|
||||
DEBUG_ASSERT(token_after_is(tu, file, cur, end, ">")
|
||||
|| token_after_is(tu, file, cur, end, ","),
|
||||
detail::parse_error_handler{}, cur,
|
||||
"unexpected token in variadic parameter workaround");
|
||||
}
|
||||
else if ((kind == CXCursor_TemplateTypeParameter
|
||||
|| kind == CXCursor_NonTypeTemplateParameter
|
||||
|| kind == CXCursor_TemplateTemplateParameter)
|
||||
|
|
@ -173,7 +185,8 @@ namespace
|
|||
&& !token_after_is(tu, file, cur, end, ","))
|
||||
{
|
||||
DEBUG_ASSERT(token_after_is(tu, file, cur, get_next_location(tu, file, end, -2), ">>"),
|
||||
detail::assert_handler{});
|
||||
detail::parse_error_handler{}, cur,
|
||||
"unexpected token in maximal munch workaround");
|
||||
unmunch = true;
|
||||
// need to shrink range anyway
|
||||
end = get_next_location(tu, file, end, -1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue