Skip to content
Snippets Groups Projects
Commit 0844170e authored by Patrick Palka's avatar Patrick Palka
Browse files

c++: constexpr union member access folding [PR114709]


The object/offset canonicalization performed in cxx_fold_indirect_ref
is undesirable for union member accesses because it loses information
about the member being accessed which we may later need to diagnose an
inactive-member access.  So this patch restricts the canonicalization
accordingly.

	PR c++/114709

gcc/cp/ChangeLog:

	* constexpr.cc (cxx_fold_indirect_ref): Restrict object/offset
	canonicalization to RECORD_TYPE member accesses.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/constexpr-union8.C: New test.

Reviewed-by: default avatarJason Merrill <jason@redhat.com>
parent 97a54c05
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment