Skip to content

templatesimplifier.cpp: fixed clang-analyzer-alpha.core.Conversion warning in getTemplateInstantiations()#7384

Merged
firewave merged 1 commit intocppcheck-opensource:mainfrom
firewave:temp-conv
Mar 27, 2025
Merged

templatesimplifier.cpp: fixed clang-analyzer-alpha.core.Conversion warning in getTemplateInstantiations()#7384
firewave merged 1 commit intocppcheck-opensource:mainfrom
firewave:temp-conv

Conversation

@firewave
Copy link
Copy Markdown
Collaborator

/home/runner/work/cppcheck/cppcheck/lib/templatesimplifier.cpp:824:42: error: Loss of sign in implicit conversion [clang-analyzer-alpha.core.Conversion,-warnings-as-errors]
  824 |                 const unsigned int pos = getTemplateNamePosition(tok);
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

…warning in `getTemplateInstantiations()`

/home/runner/work/cppcheck/cppcheck/lib/templatesimplifier.cpp:824:42: error: Loss of sign in implicit conversion [clang-analyzer-alpha.core.Conversion,-warnings-as-errors]
  824 |                 const unsigned int pos = getTemplateNamePosition(tok);
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
@firewave
Copy link
Copy Markdown
Collaborator Author

I am pretty sure one of the compiler warnings we are too smart for to enable would have caught this as well.

@firewave firewave merged commit 5a9d0b3 into cppcheck-opensource:main Mar 27, 2025
60 checks passed
@firewave firewave deleted the temp-conv branch March 27, 2025 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant