[Bug c++/92947] Parenthesized aggregate initialization doesn't work with the library types it's supposed to work with
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Feb 7 22:01:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92947
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:ac6eaa55a5199196ea0a25763114ce05333a14d3
commit r10-6519-gac6eaa55a5199196ea0a25763114ce05333a14d3
Author: Marek Polacek <polacek@redhat.com>
Date: Fri Feb 7 14:44:25 2020 -0500
c++: Fix paren init of aggregates in unevaluated context [PR92947]
When I implemented C++20 parenthesized initialization of aggregates
I introduced this bogus cp_unevaluated_operand check, thus disabling
this feature in unevaluated context. Oop.
Removing the check turned up another bug: I wasn't checking the
return value of digest_init. So when constructible_expr called
build_new_method_call_1 to see if we can construct one type from
another, it got back a bogus INIT_EXPR that looked something like
*(struct T &) 1 = <<< error >>>. But that isn't the error_mark_node,
so constructible_expr thought we had been successful in creating the
ctor call, and it gave the wrong answer. Covered by paren-init17.C.
PR c++/92947 - Paren init of aggregates in unevaluated context.
* call.c (build_new_method_call_1): Don't check
cp_unevaluated_operand. Check the return value of digest_init.
* g++.dg/cpp2a/paren-init21.C: New test.
More information about the Gcc-bugs
mailing list