c++: Fix rejects-valid bug in cxx_eval_outermost_constant_expr [PR93905]
The following testcase is rejected in 8.3, but was accepted in 8.2 and
is in 9.x. This started with my PR87934
* constexpr.c (cxx_eval_constant_expression) <case CONSTRUCTOR>: Do
re-process TREE_CONSTANT CONSTRUCTORs if they aren't reduced constant
expressions.
backport, where the NSDMI CONSTRUCTOR that contains CONST_DECLs is now
constexpr evaluated so that it doesn't contain them. The difference from
9.x is that 9.x doesn't call get_target_expr if we got a CONSTRUCTOR for a
class type for something that has been originally a CONSTRUCTOR too.
This patch cherry-picks just that hunk of the r9-3835 change.
2020-02-26 Jakub Jelinek <jakub@redhat.com>
PR c++/93905
Backported from mainline
2018-11-04 Jason Merrill <jason@redhat.com>
* constexpr.c (cxx_eval_outermost_constant_expr): Don't wrap a
CONSTRUCTOR if one was passed in.
* g++.dg/cpp0x/pr93905.C: New test.