re PR c++/89481 (constexpr function allows writing one active union member and readin...
authorJakub Jelinek <jakub@redhat.com>
Tue, 26 Feb 2019 14:37:39 +0000 (15:37 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 26 Feb 2019 14:37:39 +0000 (15:37 +0100)
commitc7f7c313c0da09232ced316ebb9806bd0f70405c
tree042a5de16a25d6b84a493f189ce6d45b60833c41
parent01c3ddcffb38e92e0f59aeb270e4848a5b8941f0
re PR c++/89481 (constexpr function allows writing one active union member and reading another)

PR c++/89481
* constexpr.c (cxx_eval_store_expression): When changing active union
member, set no_zero_init.

* g++.dg/cpp1y/constexpr-89481.C: New test.

From-SVN: r269213
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1y/constexpr-89481.C [new file with mode: 0644]