Skip to content

Commit 52f2daa

Browse files
jketemaCopilot
andcommitted
Simplify pack regression arithmetic
Remove unsigned literal suffixes and the unnecessary cast from the sum reproducer. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 6e6b94a commit 52f2daa

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • cpp/ql/test/query-tests/Best Practices/Unused Entities/UnusedStaticVariables

‎cpp/ql/test/query-tests/Best Practices/Unused Entities/UnusedStaticVariables/test.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static WithDestructor destructed; // GOOD (destructor has a side effect)
5252

5353
static auto sum(auto... values) // $ SPURIOUS: Alert
5454
{
55-
return (0U + ... + static_cast<unsigned>(values));
55+
return (0 + ... + values);
5656
}
5757

58-
unsigned result = sum() + sum(2U);
58+
unsigned result = sum() + sum(2);

0 commit comments

Comments
 (0)