[Bug c++/92878] Parenthesized aggregate initialization doesn't work in a new-expression
ville.voutilainen at gmail dot com
gcc-bugzilla@gcc.gnu.org
Sat Dec 14 23:28:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92878
--- Comment #9 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
This seems to do the right thing for __is_constructible. I haven't looked at
decltype or noexcept yet.
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 97c27c51ea3..4b8daf8634f 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -1742,8 +1742,11 @@ constructible_expr (tree to, tree from)
tree ob = build_stub_object (to);
for (; from; from = TREE_CHAIN (from))
vec_safe_push (args, build_stub_object (TREE_VALUE (from)));
- expr = build_special_member_call (ob, complete_ctor_identifier, &args,
- ctype, LOOKUP_NORMAL, tf_none);
+ if (CP_AGGREGATE_TYPE_P (ctype))
+ expr = build_aggr_init(ob, from, LOOKUP_NORMAL, tf_none);
+ else
+ expr = build_special_member_call (ob, complete_ctor_identifier, &args,
+ ctype, LOOKUP_NORMAL, tf_none);
if (expr == error_mark_node)
return error_mark_node;
/* The current state of the standard vis-a-vis LWG 2116 is that
More information about the Gcc-bugs
mailing list