On Sun, May 12, 2013 at 1:18 AM, Florian Weimer <span dir="ltr"><<a href="mailto:fweimer@redhat.com" target="_blank">fweimer@redhat.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
clang++ (trunk, both C++03 and C++11 modes) rejects the following program:<br>
<br>
union u {<br>
  int a;<br>
  char b[sizeof(a)];<br>
};<br>
<br>
t.cpp:3:17: error: invalid use of non-static data member 'a'<br>
  char b[sizeof(a)];<br>
                ^<br>
<br>
This seems valid C++, considering this language in [expr.prim.general]: "An id-expression that denotes a non-static data member […] can only be used […] if that id-expression […] appears in an unevaluated operand"</blockquote>
<div><br></div><div>Trunk accepts this for me in C++11, and rejects in C++98, which IIRC is correct behavior.</div></div>