]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: printing AGGR_INIT_EXPR args
authorJason Merrill <jason@redhat.com>
Tue, 22 Oct 2024 21:45:00 +0000 (17:45 -0400)
committerJason Merrill <jason@redhat.com>
Tue, 29 Oct 2024 16:25:18 +0000 (12:25 -0400)
commite6d21cbf5cf035b6fa9946a4321f87cbcfa9f275
tree0072b34c0d4e3c1f4ab7753e4c0e8f7297a9c034
parentf003834badbfd9d0c0ad132de8b2f3d550ed120f
c++: printing AGGR_INIT_EXPR args

PR30854 was about wrongly dumping the dummy object argument to a
constructor; r126582 in 4.3 fixed that by skipping the first argument.  But
not all functions called by AGGR_INIT_EXPR are constructors, as observed in
PR116634; we shouldn't skip for non-member functions.  And let's combine the
printing code for CALL_EXPR and AGGR_INIT_EXPR.

This doesn't make us accept the ill-formed 116634 testcase again with a
pedwarn, just fixes the diagnostic issue.

PR c++/30854
PR c++/116634

gcc/cp/ChangeLog:

* error.cc (dump_aggr_init_expr_args): Remove.
(dump_call_expr_args): Handle AGGR_INIT_EXPR.
(dump_expr): Combine AGGR_INIT_EXPR and CALL_EXPR cases.

gcc/testsuite/ChangeLog:

* g++.dg/coroutines/coro-bad-alloc-02-no-op-new-nt.C: Adjust
diagnostic.
* g++.dg/diagnostic/aggr-init1.C: New test.
gcc/cp/error.cc
gcc/testsuite/g++.dg/coroutines/coro-bad-alloc-02-no-op-new-nt.C
gcc/testsuite/g++.dg/diagnostic/aggr-init1.C [new file with mode: 0644]