10e2c34f92f00628d48968dfea096d36381f494cbStephen Hines// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify -std=c++98 -Wno-inaccessible-base 20e2c34f92f00628d48968dfea096d36381f494cbStephen Hines// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify -std=c++11 -Wno-inaccessible-base 38e8fb3be5bd78f0564444eca02b404566a5f3b5dAndy Gibbs// expected-no-diagnostics 474cbe226207fd101623638dadfa7fbada04ff2a6Anders Carlsson 574cbe226207fd101623638dadfa7fbada04ff2a6Anders Carlsson#define SA(n, p) int a##n[(p) ? 1 : -1] 674cbe226207fd101623638dadfa7fbada04ff2a6Anders Carlsson 774cbe226207fd101623638dadfa7fbada04ff2a6Anders Carlssonstruct A { 874cbe226207fd101623638dadfa7fbada04ff2a6Anders Carlsson int a; 974cbe226207fd101623638dadfa7fbada04ff2a6Anders Carlsson char b; 1074cbe226207fd101623638dadfa7fbada04ff2a6Anders Carlsson}; 1174cbe226207fd101623638dadfa7fbada04ff2a6Anders Carlsson 1274cbe226207fd101623638dadfa7fbada04ff2a6Anders CarlssonSA(0, sizeof(A) == 8); 1374cbe226207fd101623638dadfa7fbada04ff2a6Anders Carlsson 1474cbe226207fd101623638dadfa7fbada04ff2a6Anders Carlssonstruct B : A { 1574cbe226207fd101623638dadfa7fbada04ff2a6Anders Carlsson char c; 1674cbe226207fd101623638dadfa7fbada04ff2a6Anders Carlsson}; 1774cbe226207fd101623638dadfa7fbada04ff2a6Anders Carlsson 1874cbe226207fd101623638dadfa7fbada04ff2a6Anders CarlssonSA(1, sizeof(B) == 12); 1974cbe226207fd101623638dadfa7fbada04ff2a6Anders Carlsson 2074cbe226207fd101623638dadfa7fbada04ff2a6Anders Carlssonstruct C { 2174cbe226207fd101623638dadfa7fbada04ff2a6Anders Carlsson// Make fields private so C won't be a POD type. 2274cbe226207fd101623638dadfa7fbada04ff2a6Anders Carlssonprivate: 2374cbe226207fd101623638dadfa7fbada04ff2a6Anders Carlsson int a; 2474cbe226207fd101623638dadfa7fbada04ff2a6Anders Carlsson char b; 2574cbe226207fd101623638dadfa7fbada04ff2a6Anders Carlsson}; 2674cbe226207fd101623638dadfa7fbada04ff2a6Anders Carlsson 2774cbe226207fd101623638dadfa7fbada04ff2a6Anders CarlssonSA(2, sizeof(C) == 8); 2874cbe226207fd101623638dadfa7fbada04ff2a6Anders Carlsson 2974cbe226207fd101623638dadfa7fbada04ff2a6Anders Carlssonstruct D : C { 3074cbe226207fd101623638dadfa7fbada04ff2a6Anders Carlsson char c; 3174cbe226207fd101623638dadfa7fbada04ff2a6Anders Carlsson}; 3274cbe226207fd101623638dadfa7fbada04ff2a6Anders Carlsson 3374cbe226207fd101623638dadfa7fbada04ff2a6Anders CarlssonSA(3, sizeof(D) == 8); 34227aad58cc46c15dfc3fee2244d4a56d8c003d8fAnders Carlsson 35227aad58cc46c15dfc3fee2244d4a56d8c003d8fAnders Carlssonstruct __attribute__((packed)) E { 36227aad58cc46c15dfc3fee2244d4a56d8c003d8fAnders Carlsson char b; 37227aad58cc46c15dfc3fee2244d4a56d8c003d8fAnders Carlsson int a; 38227aad58cc46c15dfc3fee2244d4a56d8c003d8fAnders Carlsson}; 39227aad58cc46c15dfc3fee2244d4a56d8c003d8fAnders Carlsson 40227aad58cc46c15dfc3fee2244d4a56d8c003d8fAnders CarlssonSA(4, sizeof(E) == 5); 41227aad58cc46c15dfc3fee2244d4a56d8c003d8fAnders Carlsson 42227aad58cc46c15dfc3fee2244d4a56d8c003d8fAnders Carlssonstruct __attribute__((packed)) F : E { 43227aad58cc46c15dfc3fee2244d4a56d8c003d8fAnders Carlsson char d; 44227aad58cc46c15dfc3fee2244d4a56d8c003d8fAnders Carlsson}; 45227aad58cc46c15dfc3fee2244d4a56d8c003d8fAnders Carlsson 46227aad58cc46c15dfc3fee2244d4a56d8c003d8fAnders CarlssonSA(5, sizeof(F) == 6); 47b237fd6f36145c023ed12fe83f21727cbe197158Anders Carlsson 48b237fd6f36145c023ed12fe83f21727cbe197158Anders Carlssonstruct G { G(); }; 49b237fd6f36145c023ed12fe83f21727cbe197158Anders Carlssonstruct H : G { }; 50b237fd6f36145c023ed12fe83f21727cbe197158Anders Carlsson 51b237fd6f36145c023ed12fe83f21727cbe197158Anders CarlssonSA(6, sizeof(H) == 1); 52e4fc0d97420e13d13c9664a3c27c17aa7c1e47b9Anders Carlsson 530b4c9b5834a0a5520d2cd32227a53cf7f73fedcaDouglas Gregorstruct I { 540b4c9b5834a0a5520d2cd32227a53cf7f73fedcaDouglas Gregor char b; 550b4c9b5834a0a5520d2cd32227a53cf7f73fedcaDouglas Gregor int a; 560b4c9b5834a0a5520d2cd32227a53cf7f73fedcaDouglas Gregor} __attribute__((packed)); 570b4c9b5834a0a5520d2cd32227a53cf7f73fedcaDouglas Gregor 580b4c9b5834a0a5520d2cd32227a53cf7f73fedcaDouglas GregorSA(6_1, sizeof(I) == 5); 590b4c9b5834a0a5520d2cd32227a53cf7f73fedcaDouglas Gregor 60e4fc0d97420e13d13c9664a3c27c17aa7c1e47b9Anders Carlsson// PR5580 61e4fc0d97420e13d13c9664a3c27c17aa7c1e47b9Anders Carlssonnamespace PR5580 { 62e4fc0d97420e13d13c9664a3c27c17aa7c1e47b9Anders Carlsson 63e4fc0d97420e13d13c9664a3c27c17aa7c1e47b9Anders Carlssonclass A { bool iv0 : 1; }; 64e4fc0d97420e13d13c9664a3c27c17aa7c1e47b9Anders CarlssonSA(7, sizeof(A) == 1); 65e4fc0d97420e13d13c9664a3c27c17aa7c1e47b9Anders Carlsson 66e4fc0d97420e13d13c9664a3c27c17aa7c1e47b9Anders Carlssonclass B : A { bool iv0 : 1; }; 67e4fc0d97420e13d13c9664a3c27c17aa7c1e47b9Anders CarlssonSA(8, sizeof(B) == 2); 68e4fc0d97420e13d13c9664a3c27c17aa7c1e47b9Anders Carlsson 69e4fc0d97420e13d13c9664a3c27c17aa7c1e47b9Anders Carlssonstruct C { bool iv0 : 1; }; 70e4fc0d97420e13d13c9664a3c27c17aa7c1e47b9Anders CarlssonSA(9, sizeof(C) == 1); 71e4fc0d97420e13d13c9664a3c27c17aa7c1e47b9Anders Carlsson 72e4fc0d97420e13d13c9664a3c27c17aa7c1e47b9Anders Carlssonstruct D : C { bool iv0 : 1; }; 73e4fc0d97420e13d13c9664a3c27c17aa7c1e47b9Anders CarlssonSA(10, sizeof(D) == 2); 74e4fc0d97420e13d13c9664a3c27c17aa7c1e47b9Anders Carlsson 75e4fc0d97420e13d13c9664a3c27c17aa7c1e47b9Anders Carlsson} 763cd09ccbb1a750a7b40593a7b0a2d95ee2a0ba0eAnders Carlsson 773cd09ccbb1a750a7b40593a7b0a2d95ee2a0ba0eAnders Carlssonnamespace Test1 { 783cd09ccbb1a750a7b40593a7b0a2d95ee2a0ba0eAnders Carlsson 793cd09ccbb1a750a7b40593a7b0a2d95ee2a0ba0eAnders Carlsson// Test that we don't assert on this hierarchy. 803cd09ccbb1a750a7b40593a7b0a2d95ee2a0ba0eAnders Carlssonstruct A { }; 813cd09ccbb1a750a7b40593a7b0a2d95ee2a0ba0eAnders Carlssonstruct B : A { virtual void b(); }; 823cd09ccbb1a750a7b40593a7b0a2d95ee2a0ba0eAnders Carlssonclass C : virtual A { int c; }; 833cd09ccbb1a750a7b40593a7b0a2d95ee2a0ba0eAnders Carlssonstruct D : virtual B { }; 843cd09ccbb1a750a7b40593a7b0a2d95ee2a0ba0eAnders Carlssonstruct E : C, virtual D { }; 853cd09ccbb1a750a7b40593a7b0a2d95ee2a0ba0eAnders Carlssonclass F : virtual E { }; 863cd09ccbb1a750a7b40593a7b0a2d95ee2a0ba0eAnders Carlssonstruct G : virtual E, F { }; 873cd09ccbb1a750a7b40593a7b0a2d95ee2a0ba0eAnders Carlsson 883cd09ccbb1a750a7b40593a7b0a2d95ee2a0ba0eAnders CarlssonSA(0, sizeof(G) == 24); 8983a45e7dab892e9efd3515eca4eb5b81bc3f2126Anders Carlsson 9083a45e7dab892e9efd3515eca4eb5b81bc3f2126Anders Carlsson} 9183a45e7dab892e9efd3515eca4eb5b81bc3f2126Anders Carlsson 9283a45e7dab892e9efd3515eca4eb5b81bc3f2126Anders Carlssonnamespace Test2 { 9383a45e7dab892e9efd3515eca4eb5b81bc3f2126Anders Carlsson 9483a45e7dab892e9efd3515eca4eb5b81bc3f2126Anders Carlsson// Test that this somewhat complex class structure is laid out correctly. 9583a45e7dab892e9efd3515eca4eb5b81bc3f2126Anders Carlssonstruct A { }; 9683a45e7dab892e9efd3515eca4eb5b81bc3f2126Anders Carlssonstruct B : A { virtual void b(); }; 9783a45e7dab892e9efd3515eca4eb5b81bc3f2126Anders Carlssonstruct C : virtual B { }; 9883a45e7dab892e9efd3515eca4eb5b81bc3f2126Anders Carlssonstruct D : virtual A { }; 9983a45e7dab892e9efd3515eca4eb5b81bc3f2126Anders Carlssonstruct E : virtual B, D { }; 10083a45e7dab892e9efd3515eca4eb5b81bc3f2126Anders Carlssonstruct F : E, virtual C { }; 10183a45e7dab892e9efd3515eca4eb5b81bc3f2126Anders Carlssonstruct G : virtual F, A { }; 10283a45e7dab892e9efd3515eca4eb5b81bc3f2126Anders Carlssonstruct H { G g; }; 10383a45e7dab892e9efd3515eca4eb5b81bc3f2126Anders Carlsson 10483a45e7dab892e9efd3515eca4eb5b81bc3f2126Anders CarlssonSA(0, sizeof(H) == 24); 10583a45e7dab892e9efd3515eca4eb5b81bc3f2126Anders Carlsson 1063cd09ccbb1a750a7b40593a7b0a2d95ee2a0ba0eAnders Carlsson} 107654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 108654005265b1faab223f055bff3dd254476df7ff5Eli Friedmannamespace PR16537 { 109654005265b1faab223f055bff3dd254476df7ff5Eli Friedmannamespace test1 { 110654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct pod_in_11_only { 111654005265b1faab223f055bff3dd254476df7ff5Eli Friedman private: 112654005265b1faab223f055bff3dd254476df7ff5Eli Friedman long long x; 113654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 114654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 115654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct tail_padded_pod_in_11_only { 116654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only pod11; 117654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char tail_padding; 118654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 119654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 120654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct might_use_tail_padding : public tail_padded_pod_in_11_only { 121654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char may_go_into_tail_padding; 122654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 123654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 124654005265b1faab223f055bff3dd254476df7ff5Eli Friedman SA(0, sizeof(might_use_tail_padding) == 16); 125654005265b1faab223f055bff3dd254476df7ff5Eli Friedman} 126654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 127654005265b1faab223f055bff3dd254476df7ff5Eli Friedmannamespace test2 { 128654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct pod_in_11_only { 129654005265b1faab223f055bff3dd254476df7ff5Eli Friedman private: 130654005265b1faab223f055bff3dd254476df7ff5Eli Friedman long long x; 131654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 132654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 133654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct tail_padded_pod_in_11_only { 134654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only pod11 __attribute__((aligned(16))); 135654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 136654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 137654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct might_use_tail_padding : public tail_padded_pod_in_11_only { 138654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char may_go_into_tail_padding; 139654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 140654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 141654005265b1faab223f055bff3dd254476df7ff5Eli Friedman SA(0, sizeof(might_use_tail_padding) == 16); 142654005265b1faab223f055bff3dd254476df7ff5Eli Friedman} 143654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 144654005265b1faab223f055bff3dd254476df7ff5Eli Friedmannamespace test3 { 145654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct pod_in_11_only { 146654005265b1faab223f055bff3dd254476df7ff5Eli Friedman private: 147654005265b1faab223f055bff3dd254476df7ff5Eli Friedman long long x; 148654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 149654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 150654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct tail_padded_pod_in_11_only { 151654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only pod11; 152654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char tail_padding; 153654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 154654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 155654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct second_base { 156654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char foo; 157654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 158654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 159654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct might_use_tail_padding : public tail_padded_pod_in_11_only, public second_base { 160654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 161654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 162654005265b1faab223f055bff3dd254476df7ff5Eli Friedman SA(0, sizeof(might_use_tail_padding) == 16); 163654005265b1faab223f055bff3dd254476df7ff5Eli Friedman} 164654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 165654005265b1faab223f055bff3dd254476df7ff5Eli Friedmannamespace test4 { 166654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct pod_in_11_only { 167654005265b1faab223f055bff3dd254476df7ff5Eli Friedman private: 168654005265b1faab223f055bff3dd254476df7ff5Eli Friedman long long x; 169654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 170654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 171654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct tail_padded_pod_in_11_only { 172654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only pod11; 173654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char tail_padding; 174654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 175654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 176654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct second_base { 177654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char foo; 178654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 179654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 180654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct might_use_tail_padding : public tail_padded_pod_in_11_only, public second_base { 181654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char may_go_into_tail_padding; 182654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 183654005265b1faab223f055bff3dd254476df7ff5Eli Friedman SA(0, sizeof(might_use_tail_padding) == 16); 184654005265b1faab223f055bff3dd254476df7ff5Eli Friedman} 185654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 186654005265b1faab223f055bff3dd254476df7ff5Eli Friedmannamespace test5 { 187654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct pod_in_11_only { 188654005265b1faab223f055bff3dd254476df7ff5Eli Friedman private: 189654005265b1faab223f055bff3dd254476df7ff5Eli Friedman long long x; 190654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 191654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 192654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct pod_in_11_only2 { 193654005265b1faab223f055bff3dd254476df7ff5Eli Friedman private: 194654005265b1faab223f055bff3dd254476df7ff5Eli Friedman long long x; 195654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 196654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 197654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct tail_padded_pod_in_11_only { 198654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only pod11; 199654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char tail_padding; 200654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 201654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 202654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct second_base { 203654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only2 two; 204654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char foo; 205654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 206654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 207654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct might_use_tail_padding : public tail_padded_pod_in_11_only, public second_base { 208654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char may_go_into_tail_padding; 209654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 210654005265b1faab223f055bff3dd254476df7ff5Eli Friedman SA(0, sizeof(might_use_tail_padding) == 32); 211654005265b1faab223f055bff3dd254476df7ff5Eli Friedman} 212654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 213654005265b1faab223f055bff3dd254476df7ff5Eli Friedmannamespace test6 { 214654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct pod_in_11_only { 215654005265b1faab223f055bff3dd254476df7ff5Eli Friedman private: 216654005265b1faab223f055bff3dd254476df7ff5Eli Friedman long long x; 217654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 218654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 219654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct pod_in_11_only2 { 220654005265b1faab223f055bff3dd254476df7ff5Eli Friedman private: 221654005265b1faab223f055bff3dd254476df7ff5Eli Friedman long long x; 222654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 223654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 224654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct tail_padded_pod_in_11_only { 225654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only pod11; 226654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char tail_padding; 227654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 228654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 229654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct second_base { 230654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only2 two; 231654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char foo; 232654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 233654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 234654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct might_use_tail_padding : public tail_padded_pod_in_11_only, public second_base { 235654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char may_go_into_tail_padding; 236654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 237654005265b1faab223f055bff3dd254476df7ff5Eli Friedman SA(0, sizeof(might_use_tail_padding) == 32); 238654005265b1faab223f055bff3dd254476df7ff5Eli Friedman} 239654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 240654005265b1faab223f055bff3dd254476df7ff5Eli Friedmannamespace test7 { 241654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct pod_in_11_only { 242654005265b1faab223f055bff3dd254476df7ff5Eli Friedman private: 243654005265b1faab223f055bff3dd254476df7ff5Eli Friedman long long x; 244654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 245654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 246654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct tail_padded_pod_in_11_only { 247654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only pod11; 248654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only pod12; 249654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char tail_padding; 250654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 251654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 252654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct might_use_tail_padding : public tail_padded_pod_in_11_only { 253654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char may_go_into_tail_padding; 254654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 255654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 256654005265b1faab223f055bff3dd254476df7ff5Eli Friedman SA(0, sizeof(might_use_tail_padding) == 24); 257654005265b1faab223f055bff3dd254476df7ff5Eli Friedman} 258654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 259654005265b1faab223f055bff3dd254476df7ff5Eli Friedmannamespace test8 { 260654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct pod_in_11_only { 261654005265b1faab223f055bff3dd254476df7ff5Eli Friedman private: 262654005265b1faab223f055bff3dd254476df7ff5Eli Friedman long long x; 263654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 264654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 265654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct tail_padded_pod_in_11_only { 266654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only pod11; 267654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char tail_padding; 268654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 269654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 270654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct another_layer { 271654005265b1faab223f055bff3dd254476df7ff5Eli Friedman tail_padded_pod_in_11_only pod; 272654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char padding; 273654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 274654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 275654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct might_use_tail_padding : public another_layer { 276654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char may_go_into_tail_padding; 277654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 278654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 279654005265b1faab223f055bff3dd254476df7ff5Eli Friedman SA(0, sizeof(might_use_tail_padding) == 24); 280654005265b1faab223f055bff3dd254476df7ff5Eli Friedman} 281654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 282654005265b1faab223f055bff3dd254476df7ff5Eli Friedmannamespace test9 { 283654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct pod_in_11_only { 284654005265b1faab223f055bff3dd254476df7ff5Eli Friedman private: 285654005265b1faab223f055bff3dd254476df7ff5Eli Friedman long long x; 286654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 287654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 288654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct tail_padded_pod_in_11_only { 289654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only pod11; 290654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char tail_padding; 291654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 292654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 293654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct another_layer : tail_padded_pod_in_11_only { 294654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 295654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 296654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct might_use_tail_padding : public another_layer { 297654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char may_go_into_tail_padding; 298654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 299654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 300654005265b1faab223f055bff3dd254476df7ff5Eli Friedman SA(0, sizeof(might_use_tail_padding) == 16); 301654005265b1faab223f055bff3dd254476df7ff5Eli Friedman} 302654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 303654005265b1faab223f055bff3dd254476df7ff5Eli Friedmannamespace test10 { 304654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct pod_in_11_only { 305654005265b1faab223f055bff3dd254476df7ff5Eli Friedman private: 306654005265b1faab223f055bff3dd254476df7ff5Eli Friedman long long x; 307654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 308654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 309654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct A { 310654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only a; 311654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char apad; 312654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 313654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 314654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct B { 315654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char b; 316654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 317654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 318654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct C { 319654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only c; 320654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char cpad; 321654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 322654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 323654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct D { 324654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char d; 325654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 326654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 327654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct might_use_tail_padding : public A, public B, public C, public D { 328654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 329654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 330654005265b1faab223f055bff3dd254476df7ff5Eli Friedman SA(0, sizeof(might_use_tail_padding) == 32); 331654005265b1faab223f055bff3dd254476df7ff5Eli Friedman} 332654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 333654005265b1faab223f055bff3dd254476df7ff5Eli Friedmannamespace test11 { 334654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct pod_in_11_only { 335654005265b1faab223f055bff3dd254476df7ff5Eli Friedman private: 336654005265b1faab223f055bff3dd254476df7ff5Eli Friedman long long x; 337654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 338654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 339654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct A { 340654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only a; 341654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char apad; 342654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 343654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 344654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct B { 345654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char b_pre; 346654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only b; 347654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char bpad; 348654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 349654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 350654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct C { 351654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char c_pre; 352654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only c; 353654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char cpad; 354654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 355654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 356654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct D { 357654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char d_pre; 358654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only d; 359654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char dpad; 360654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 361654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 362654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct might_use_tail_padding : public A, public B, public C, public D { 363654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char m; 364654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 365654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 366654005265b1faab223f055bff3dd254476df7ff5Eli Friedman SA(0, sizeof(might_use_tail_padding) == 88); 367654005265b1faab223f055bff3dd254476df7ff5Eli Friedman} 368654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 369654005265b1faab223f055bff3dd254476df7ff5Eli Friedmannamespace test12 { 370654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct pod_in_11_only { 371654005265b1faab223f055bff3dd254476df7ff5Eli Friedman private: 372654005265b1faab223f055bff3dd254476df7ff5Eli Friedman long long x; 373654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 374654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 375654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct A { 376654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only a __attribute__((aligned(128))); 377654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 378654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 379654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct B { 380654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char bpad; 381654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 382654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 383654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct C { 384654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char cpad; 385654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 386654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 387654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct D { 388654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char dpad; 389654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 390654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 391654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct might_use_tail_padding : public A, public B, public C, public D { 392654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char m; 393654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 394654005265b1faab223f055bff3dd254476df7ff5Eli Friedman SA(0, sizeof(might_use_tail_padding) == 128); 395654005265b1faab223f055bff3dd254476df7ff5Eli Friedman} 396654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 397654005265b1faab223f055bff3dd254476df7ff5Eli Friedmannamespace test13 { 398654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct pod_in_11_only { 399654005265b1faab223f055bff3dd254476df7ff5Eli Friedman private: 400654005265b1faab223f055bff3dd254476df7ff5Eli Friedman long long x; 401654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 402654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 403654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct A { 404654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only a; 405654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char apad; 406654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 407654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 408654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct B { 409654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 410654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 411654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct C { 412654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char c_pre; 413654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only c; 414654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char cpad; 415654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 416654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 417654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct D { 418654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 419654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 420654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct might_use_tail_padding : public A, public B, public C, public D { 421654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char m; 422654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 423654005265b1faab223f055bff3dd254476df7ff5Eli Friedman SA(0, sizeof(might_use_tail_padding) == 40); 424654005265b1faab223f055bff3dd254476df7ff5Eli Friedman} 425654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 426654005265b1faab223f055bff3dd254476df7ff5Eli Friedmannamespace test14 { 427654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct pod_in_11_only { 428654005265b1faab223f055bff3dd254476df7ff5Eli Friedman private: 429654005265b1faab223f055bff3dd254476df7ff5Eli Friedman long long x; 430654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 431654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 432654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct A { 433654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only a; 434654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char apad; 435654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 436654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 437654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct might_use_tail_padding : public A { 438654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct { 439654005265b1faab223f055bff3dd254476df7ff5Eli Friedman int : 0; 440654005265b1faab223f055bff3dd254476df7ff5Eli Friedman } x; 441654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 442654005265b1faab223f055bff3dd254476df7ff5Eli Friedman SA(0, sizeof(might_use_tail_padding) == 16); 443654005265b1faab223f055bff3dd254476df7ff5Eli Friedman} 444654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 445654005265b1faab223f055bff3dd254476df7ff5Eli Friedmannamespace test15 { 446654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct pod_in_11_only { 447654005265b1faab223f055bff3dd254476df7ff5Eli Friedman private: 448654005265b1faab223f055bff3dd254476df7ff5Eli Friedman long long x; 449654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 450654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 451654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct A { 452654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only a; 453654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char apad; 454654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 455654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 456654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct might_use_tail_padding : public A { 457654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct { 458654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char a:1; 459654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char b:2; 460654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char c:2; 461654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char d:2; 462654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char e:1; 463654005265b1faab223f055bff3dd254476df7ff5Eli Friedman } x; 464654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 465654005265b1faab223f055bff3dd254476df7ff5Eli Friedman SA(0, sizeof(might_use_tail_padding) == 16); 466654005265b1faab223f055bff3dd254476df7ff5Eli Friedman} 467654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 468654005265b1faab223f055bff3dd254476df7ff5Eli Friedmannamespace test16 { 469654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct pod_in_11_only { 470654005265b1faab223f055bff3dd254476df7ff5Eli Friedman private: 471654005265b1faab223f055bff3dd254476df7ff5Eli Friedman long long x; 472654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 473654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 474654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct A { 475654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only a; 476654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char apad; 477654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 478654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 479654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct B { 480654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char bpod; 481654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only b; 482654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char bpad; 483654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 484654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 485654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct C : public A, public B { 486654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 487654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 488654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct D : public C { 489654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 490654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 491654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct might_use_tail_padding : public D { 492654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char m; 493654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 494654005265b1faab223f055bff3dd254476df7ff5Eli Friedman SA(0, sizeof(might_use_tail_padding) == 40); 495654005265b1faab223f055bff3dd254476df7ff5Eli Friedman} 496654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 497654005265b1faab223f055bff3dd254476df7ff5Eli Friedmannamespace test17 { 498654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct pod_in_11_only { 499654005265b1faab223f055bff3dd254476df7ff5Eli Friedman private: 500654005265b1faab223f055bff3dd254476df7ff5Eli Friedman long long x; 501654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 502654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 503654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct A { 504654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only a __attribute__((aligned(512))); 505654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 506654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 507654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct B { 508654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char bpad; 509654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only foo; 510654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char btail; 511654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 512654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 513654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct C { 514654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char cpad; 515654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 516654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 517654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct D { 518654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char dpad; 519654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 520654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 521654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct might_use_tail_padding : public A, public B, public C, public D { 522654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char a; 523654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 524654005265b1faab223f055bff3dd254476df7ff5Eli Friedman SA(0, sizeof(might_use_tail_padding) == 512); 525654005265b1faab223f055bff3dd254476df7ff5Eli Friedman} 526654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 527654005265b1faab223f055bff3dd254476df7ff5Eli Friedmannamespace test18 { 528654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct pod_in_11_only { 529654005265b1faab223f055bff3dd254476df7ff5Eli Friedman private: 530654005265b1faab223f055bff3dd254476df7ff5Eli Friedman long long x; 531654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 532654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 533654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct A { 534654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only a; 535654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char apad; 536654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 537654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 538654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct B { 539654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char bpod; 540654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only b; 541654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char bpad; 542654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 543654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 544654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct A1 { 545654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only a; 546654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char apad; 547654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 548654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 549654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct B1 { 550654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char bpod; 551654005265b1faab223f055bff3dd254476df7ff5Eli Friedman pod_in_11_only b; 552654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char bpad; 553654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 554654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 555654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct C : public A, public B { 556654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 557654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 558654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct D : public A1, public B1 { 559654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 560654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 561654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct E : public D, public C { 562654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 563654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 564654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct F : public E { 565654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 566654005265b1faab223f055bff3dd254476df7ff5Eli Friedman 567654005265b1faab223f055bff3dd254476df7ff5Eli Friedman struct might_use_tail_padding : public F { 568654005265b1faab223f055bff3dd254476df7ff5Eli Friedman char m; 569654005265b1faab223f055bff3dd254476df7ff5Eli Friedman }; 570654005265b1faab223f055bff3dd254476df7ff5Eli Friedman SA(0, sizeof(might_use_tail_padding) == 80); 571654005265b1faab223f055bff3dd254476df7ff5Eli Friedman} 572654005265b1faab223f055bff3dd254476df7ff5Eli Friedman} // namespace PR16537 573