We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For the following code
template<typename U, typename ...T> void f(U, T... rest) { if constexpr (sizeof...(rest) != 0) f(rest...); } int main() { f(0, 1); }
cppinsights produce
template<typename U, typename ...T> void f(U, T... rest) { if constexpr (sizeof...(rest) != 0) f(rest...); } /* First instantiated from: insights.cpp:10 */ #ifdef INSIGHTS_USE_TEMPLATE template<> void f<int, int>(int, int __rest1) { if constexpr(1 != 0) f(__rest1); } #endif /* First instantiated from: insights.cpp:5 */ #ifdef INSIGHTS_USE_TEMPLATE template<> void f<int, >(int) { if constexpr(0 != 0) ; } #endif int main() { f(0, 1); }
Note the trailing comma in the second instantiation:
template<> void f<int, >(int) ^ here
Relevant parts of the AST for the first and second instantiations:
| |-FunctionDecl <line:2:1, line:6:1> line:2:6 used f 'void (int, int)' | | |-TemplateArgument type 'int' | | |-TemplateArgument pack | | | `-TemplateArgument type 'int' | | |-ParmVarDecl <col:8> col:9 'int':'int' ... | `-FunctionDecl <line:2:1, line:6:1> line:2:6 used f 'void (int)' | |-TemplateArgument type 'int' | |-TemplateArgument pack | |-ParmVarDecl <col:8> col:9 'int':'int' ...
The text was updated successfully, but these errors were encountered:
Hello @languagelawyer,
thank you (again) for the good analysis. A fix is already in the air.
Andreas
Sorry, something went wrong.
1021280
Merge pull request #203 from andreasfertig/fixIssue199
c4911c8
Fixed #199: An additional `,` was added after a template parameter.
No branches or pull requests
For the following code
cppinsights produce
Note the trailing comma in the second instantiation:
Relevant parts of the AST for the first and second instantiations:
The text was updated successfully, but these errors were encountered: