https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71828
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Tue Jul 19 08:44:04 2016 New Revision: 238460 URL: https://gcc.gnu.org/viewcvs?rev=238460&root=gcc&view=rev Log: Backported from mainline 2016-07-18 Jakub Jelinek <ja...@redhat.com> PR c++/71828 * constexpr.c (cxx_eval_constant_expression) <case REALPART_EXPR>: For lval don't use cxx_eval_unary_expression and instead recurse and if needed rebuild the reference. * g++.dg/cpp0x/constexpr-71828.C: New test. Added: branches/gcc-6-branch/gcc/testsuite/g++.dg/cpp0x/constexpr-71828.C Modified: branches/gcc-6-branch/gcc/cp/ChangeLog branches/gcc-6-branch/gcc/cp/constexpr.c branches/gcc-6-branch/gcc/testsuite/ChangeLog