[clang-tidy] Fix crash in `modernize-use-default-member-init`
authorAMS21 <AMS21.github@gmail.com>
Tue, 13 Jun 2023 18:00:03 +0000 (18:00 +0000)
committerPiotr Zegar <me@piotrzegar.pl>
Tue, 13 Jun 2023 18:13:52 +0000 (18:13 +0000)
commit311091e2b007ebe0da9877953a9a56a51102e60d
treef0edc4695fb0c1a8a5a671396d605b2dce32d1a6
parent92420f4aefbef49c3eccaf678bc23713a59e5eab
[clang-tidy] Fix crash in `modernize-use-default-member-init`

This was causes by `getValueOfValueInit` unconditionally calling
`getScalarTypeKind` on the member type, which would then trigger an
assertions since arrays are not scalar type.

This fixes llvm#63285

Reviewed By: PiotrZSL

Differential Revision: https://reviews.llvm.org/D152802
clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/test/clang-tidy/checkers/modernize/use-default-member-init-assignment.cpp
clang-tools-extra/test/clang-tidy/checkers/modernize/use-default-member-init.cpp