c++: Fix constexpr vs. omitted aggregate init.
authorJason Merrill <jason@redhat.com>
Tue, 4 Feb 2020 20:54:17 +0000 (15:54 -0500)
committerJason Merrill <jason@redhat.com>
Tue, 4 Feb 2020 22:22:15 +0000 (17:22 -0500)
commit0712ea6313bc44f9ae8feb235c1b02c92cdd0527
tree3aa6e9002bb84eff5d079942d90f2d4820928362
parenta1c9c9ff06ab15e697d5bac6ea6e5da2df840cf5
c++: Fix constexpr vs. omitted aggregate init.

Value-initialization is importantly different from {}-initialization for
this testcase, where the former calls the deleted S constructor and the
latter initializes S happily.

PR c++/90951
* constexpr.c (cxx_eval_array_reference): {}-initialize missing
elements instead of value-initializing them.
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/testsuite/g++.dg/cpp0x/constexpr-array24.C [new file with mode: 0644]