+2020-02-07 Marek Polacek <polacek@redhat.com>
+
+ 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.
+
2020-02-06 Jason Merrill <jason@redhat.com>
PR c++/92654
the two. */
if (DECL_CONSTRUCTOR_P (fn)
&& !(flags & LOOKUP_ONLYCONVERTING)
- && !cp_unevaluated_operand
&& cxx_dialect >= cxx2a
&& CP_AGGREGATE_TYPE_P (basetype)
&& !user_args->is_empty ())
else
{
ctor = digest_init (basetype, ctor, complain);
+ if (ctor == error_mark_node)
+ return error_mark_node;
ctor = build2 (INIT_EXPR, TREE_TYPE (instance), instance, ctor);
TREE_SIDE_EFFECTS (ctor) = true;
return ctor;
+2020-02-07 Marek Polacek <polacek@redhat.com>
+
+ PR c++/92947 - Paren init of aggregates in unevaluated context.
+ * g++.dg/cpp2a/paren-init21.C: New test.
+
2020-02-07 Will Schmidt <will_schmidt@vnet.ibm.com>
* testsuite/gcc.target/powerpc/pr92923-1.c: Add -mvsx.
--- /dev/null
+// PR c++/92947 - Paren init of aggregates in unevaluated context.
+// { dg-do compile { target c++2a } }
+
+struct A {
+ int a;
+ int b;
+};
+
+int main()
+{
+ static_assert(__is_constructible(A, int, int));
+ decltype(A(1,2)) foo;
+ bool b = noexcept(A(1,2));
+}