diff options
author | Jakub Jelinek <jakub@redhat.com> | 2020-10-01 11:18:35 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2020-10-01 11:18:35 +0200 |
commit | 56da736cc6ced0f1c339744321a14ae569db8606 (patch) | |
tree | d08f30c2a40c9fdc6d4b5d50cd0f429f3251999e /gcc/tree-ssa-threadedge.c | |
parent | 2805fcb32660bc0cdcd5ba54310f1f02651e039f (diff) | |
download | gcc-56da736cc6ced0f1c339744321a14ae569db8606.zip gcc-56da736cc6ced0f1c339744321a14ae569db8606.tar.gz gcc-56da736cc6ced0f1c339744321a14ae569db8606.tar.bz2 |
c++: Fix up default initialization with consteval default ctor [PR96994]
> > The following testcase is miscompiled (in particular the a and i
> > initialization). The problem is that build_special_member_call due to
> > the immediate constructors (but not evaluated in constant expression mode)
> > doesn't create a CALL_EXPR, but returns a TARGET_EXPR with CONSTRUCTOR
> > as the initializer for it,
>
> That seems like the bug; at the end of build_over_call, after you
>
> > call = cxx_constant_value (call, obj_arg);
>
> You need to build an INIT_EXPR if obj_arg isn't a dummy.
That works. obj_arg is NULL if it is a dummy from the earlier code.
2020-10-01 Jakub Jelinek <jakub@redhat.com>
PR c++/96994
* call.c (build_over_call): If obj_arg is non-NULL, return INIT_EXPR
setting obj_arg to call.
* g++.dg/cpp2a/consteval18.C: New test.
Diffstat (limited to 'gcc/tree-ssa-threadedge.c')
0 files changed, 0 insertions, 0 deletions