[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / Analysis / padding_inherit.cpp
blob2222c990a1dc1c1a4a7dd9bae7e5e51ccdad7690
1 // RUN: %clang_analyze_cc1 -std=c++14 -analyzer-checker=optin.performance -analyzer-config optin.performance.Padding:AllowedPad=20 -verify %s
3 // A class that has no fields and one base class should visit that base class
4 // instead. Note that despite having excess padding of 2, this is flagged
5 // because of its usage in an array of 100 elements below (`ais').
6 // TODO: Add a note to the bug report with BugReport::addNote() to mention the
7 // variable using the class and also mention what class is inherting from what.
8 // expected-warning@+1{{Excessive padding in 'struct FakeIntSandwich'}}
9 struct FakeIntSandwich {
10 char c1;
11 int i;
12 char c2;
15 struct AnotherIntSandwich : FakeIntSandwich { // no-warning
18 // But we don't yet support multiple base classes.
19 struct IntSandwich {};
20 struct TooManyBaseClasses : FakeIntSandwich, IntSandwich { // no-warning
23 AnotherIntSandwich ais[100];
25 struct Empty {};
26 struct DoubleEmpty : Empty { // no-warning
27 Empty e;