I wonder do you know what the template keyword does inside the template code?
This is to disambiguate the function call. Since the compiler doesnt know if begin is a variable or a function. By default, it assumes begin is a variable so < and > are treated as operators instead of template brackets.
Does anybody disagree about that?
I dont necessarily disagree, but think we should preserve this information somehow as this seems like it would be useful in createLinks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Cppcheck crashes for this code:
I wonder do you know what the
template
keyword does inside the template code?What would the proper AST be for the expression
it = gv . template begin < 0 > ( )
.Last edit: Daniel Marjamäki 2020-11-28
The clang AST for that expression:
I guess if we remove
template
tokens in such code we will get a corresponding AST in Cppcheck.Does anybody disagree about that?
Last edit: Daniel Marjamäki 2020-11-28
I will implement that simplification.. please feel free to comment if you think that will be wrong.
This is to disambiguate the function call. Since the compiler doesnt know if
begin
is a variable or a function. By default, it assumesbegin
is a variable so<
and>
are treated as operators instead of template brackets.I dont necessarily disagree, but think we should preserve this information somehow as this seems like it would be useful in
createLinks
.ok good to know.. then I will try to add a attribute instead so this information is kept..
We already skip over the template token in the template simplifier.