File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -378,7 +378,7 @@ void SizeofExpressionCheck::check(const MatchFinder::MatchResult &Result) {
378378 if (const auto *Type = dyn_cast<ArrayType>(SizeofArgTy)) {
379379 // check if the array element size is larger than one. If true,
380380 // the size of the array is higher than the number of elements
381- if (!getSizeOfType (Ctx, Type).isOne ()) {
381+ if (!getSizeOfType (Ctx, Type-> getElementType (). getTypePtr () ).isOne ()) {
382382 diag (SzOfExpr->getBeginLoc (),
383383 " suspicious usage of 'sizeof' in the loop" )
384384 << SzOfExpr->getSourceRange ();
Original file line number Diff line number Diff line change @@ -231,6 +231,10 @@ Changes in existing checks
231231 <clang-tidy/checks/bugprone/signed-char-misuse>` check by fixing
232232 false positives on C23 enums with the fixed underlying type of signed char.
233233
234+ - Improved :doc: `bugprone-sizeof-expression
235+ <clang-tidy/checks/bugprone/sizeof-expression>` check by fixing
236+ a crash on ``sizeof `` of an array of template type.
237+
234238- Improved :doc: `bugprone-tagged-union-member-count
235239 <clang-tidy/checks/bugprone/tagged-union-member-count>` by fixing a false
236240 positive when enums or unions from system header files or the ``std ``
You can’t perform that action at this time.
0 commit comments