https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80652

--- Comment #8 from rguenther at suse dot de <rguenther at suse dot de> ---
On Wed, 17 May 2017, paboyle at ph dot ed.ac.uk wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80652
> 
> --- Comment #6 from Peter Boyle <paboyle at ph dot ed.ac.uk> ---
> Just a comment -- suggest a warning thrown if union access from
> two views is made. AFAIK g++ is the only compiler not implementing the
> defacto type pun use.
> 
> http://en.cppreference.com/w/cpp/language/union
> 
> "Many compilers implement, as a non-standard language extension, the ability 
> to
> read inactive members of a union."
> 
> i.e. warn on attempted use of the above behaviour.

We do implement this if the access is through the union type.

Reply via email to