[Clang] Fix crash when checking misaligned member with dependent type
authorJun Zhang <jun@junz.org>
Tue, 18 Oct 2022 12:38:30 +0000 (20:38 +0800)
committerJun Zhang <jun@junz.org>
Tue, 18 Oct 2022 13:05:49 +0000 (21:05 +0800)
commit2946b252993d9b4c12479bf318b648bed2c0427a
tree8831b19d98d5c88d2e03b7c6e17366768278d03b
parente175f99c4977141abd53a6cd5e32b28423e44cd7
[Clang] Fix crash when checking misaligned member with dependent type

If the type is dependent, we should just discard it and not checking its
alignment as it doesn't exisit yet.
Fixes https://github.com/llvm/llvm-project/issues/58370

Differential Revision: https://reviews.llvm.org/D136018
clang/lib/Sema/SemaChecking.cpp
clang/test/SemaCXX/misaligned-member-with-depdent-type.cpp [new file with mode: 0644]