[analyzer] Allow padding checker to traverse simple class hierarchies
authorAlexander Shaposhnikov <shal1t712@gmail.com>
Tue, 30 Oct 2018 01:20:37 +0000 (01:20 +0000)
committerAlexander Shaposhnikov <shal1t712@gmail.com>
Tue, 30 Oct 2018 01:20:37 +0000 (01:20 +0000)
commite2f073463e9522b3a7effe1481eeb10a24e8c649
treea66c62d68c6ce68c01d14107be6e8aa1ae4ca241
parent7c180fa9153e743138c45e88114aab5d72b4dff5
[analyzer] Allow padding checker to traverse simple class hierarchies

The existing padding checker skips classes that have any base classes.
This patch allows the checker to traverse very simple cases:
classes that have no fields and have exactly one base class.
This is important mostly in the case of array declarations.

Patch by Max Bernstein!

Test plan: make check-all

Differential revision: https://reviews.llvm.org/D53206

llvm-svn: 345558
clang/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp
clang/test/Analysis/padding_inherit.cpp [new file with mode: 0644]