Clang and GCC accept questionable sizeof : <p>I have compilers that disagree on sizeof.  For the following code, Clang and GCC will compile it, but other compilers that I have to use fail claiming "illegal sizeof operand".  My reading of the standard says this is illegal, since <code>sizeof</code> can only take an expression (I don't think that S::a is an expression) or a type-id, but it is unusual for GCC and Clang to both be wrong.  I can obviously replace it with <code>sizeof(S().a)</code>, which works with all my compilers.</p>

<pre><code>struct S
{
   int a[32];
   int b;
   int c;
   int d[32];
};

int main()
{
   return sizeof(S::a);
}
</code></pre>

<p>Are Clang and GCC wrong, or am I misreading the standard?</p>
