[clang-tidy] Fix altera-struct-pack-align crash for struct fields with incomplete...
authorGeorgy Komarov <jubnzv@gmail.com>
Sun, 16 May 2021 05:27:46 +0000 (08:27 +0300)
committerGeorgy Komarov <jubnzv@gmail.com>
Mon, 17 May 2021 13:50:47 +0000 (16:50 +0300)
commitab92a4c26f54170bf72706ad29c0fb151a177590
treec11af8ee25dd065fe28e95120e1316d8138d10a5
parent2c9688d201a79383282c22dca2c2826688d5272c
[clang-tidy] Fix altera-struct-pack-align crash for struct fields with incomplete type

We can only use ASTContext::getTypeInfo for complete types.

This fixes bugzilla issue 50313.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D102569
clang-tools-extra/clang-tidy/altera/StructPackAlignCheck.cpp
clang-tools-extra/test/clang-tidy/checkers/altera-struct-pack-align-no-crash.cpp [new file with mode: 0644]