Struct attribute inheritance in c++
<p>Are the attributes of a struct inherited in C++</p>

<p>eg:</p>

<pre><code>struct A {
    int a;
    int b;
}__attribute__((__packed__));

struct B : A {
    list&lt;int&gt; l;
};
</code></pre>

<p>will the inherited part of struct B (struct A) inherit the packed attribute?</p>

<p>I cannot add an a <strong>attribute</strong>((<strong>packed</strong>)) to struct B without getting a compiler warning:</p>

<pre><code>ignoring packed attribute because of unpacked non-POD field
</code></pre>

<p>So I know that the entire struct B will not be packed, which is fine in my use case, but I require the fields of struct A to be packed in struct B.</p>
