re PR c++/77907 (Add "const" to argument of constexpr constructor causes the object...
authorJakub Jelinek <jakub@redhat.com>
Wed, 23 Nov 2016 18:45:27 +0000 (19:45 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 23 Nov 2016 18:45:27 +0000 (19:45 +0100)
commit25cb6b33f75fb4183bfe816cf95b68613b1af4bb
treef23f1000b81157a0be8bdb134f4e00fb059a5c2a
parent6103184e81c0b6a8b1f4e072e0c32d9bb86fcc15
re PR c++/77907 (Add "const" to argument of constexpr constructor causes the object to be left in unconstructed state)

PR c++/77907
* cp-gimplify.c (cp_fold) <case CALL_EXPR>: When calling constructor
and maybe_constant_value returns non-CALL_EXPR, create INIT_EXPR
with the object on lhs and maybe_constant_value returned expr on rhs.

* g++.dg/cpp0x/pr77907.C: New test.

From-SVN: r242790
gcc/cp/ChangeLog
gcc/cp/cp-gimplify.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/pr77907.C [new file with mode: 0644]