Repository navigation
Fix #15192 syntaxError on a pack expansion of decltype in a qualified template default argument followed by >> - #9010
chrchr-github wants to merge 2 commits into
Conversation
dmcppcheck
left a comment
There was a problem hiding this comment.
AI review
I found no problems. The change is a one-token change in TemplateSimplifier::templateParameters: a ... may now follow ). That fixes the syntax error from #15192, and it also fixes related forms that failed on base, such as sizeof(Ts)..., (expr)... and the expansion followed by , int>>. Malformed inputs I tried still give the same result as on base, and nothing crashed or hung. The new test is in the right place, splitTemplateRightAngleBrackets.
Testing
I built cppcheck and testrunner in pr/ and cppcheck in base/. Both builds succeeded.
Test suites: ./testrunner for TestTokenizer, TestGarbage, TestSimplifyTemplate, TestSymbolDatabase and TestVarID. All passed with 0 failures.
Scratch files, run with cppcheck -q --enable=all --check-level=exhaustive on base and on the PR:
N::S<decltype(Ts())...>>(the ticket's case): base givessyntaxError; the PR parses it.- The unqualified
S<decltype(Ts())...>>: no error on either build. N::S<decltype(Ts())..., int>>: base givessyntaxError; the PR parses it.N::S<int, decltype(Ts())...>>: parses on the PR.N::S<sizeof(Ts)...>>: base givessyntaxError; the PR parses it.N::S<(sizeof(Ts) > 1)...>>: base givessyntaxError; the PR parses it.N::S<(Is + ...)>>: parses on the PR.- Nested
N::W<N::S<decltype(Ts())...>>>and ausingalias inside a class template: no error on either build. - An instantiation
f<int, char>()followed by an uninitialized variable: base stops at the syntax error. The PR goes on and reportsuninitvaras expected, so checking continues after the template. - Garbage inputs:
A<(x)... ...>>,A<)...>>andX<(a)...>> b;give the same output on base and the PR, with no crash or hang.
Automated review of 33b4b3d by Claude. The pull request was built and tested locally.
No description provided.