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
{
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];
26 struct DoubleEmpty
: Empty
{ // no-warning