PR c++/92992
* call.c (convert_arg_to_ellipsis): For decltype(nullptr) arguments
that have side-effects use cp_build_compound_expr.
* g++.dg/cpp0x/nullptr45.C: New test.
From-SVN: r279680
+2019-12-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/92992
+ * call.c (convert_arg_to_ellipsis): For decltype(nullptr) arguments
+ that have side-effects use cp_build_compound_expr.
+
2019-12-20 Eric Botcazou <ebotcazou@adacore.com>
* decl2.c (c_parse_final_cleanups): Always call collect_source_ref on
arg = convert_to_real_nofold (double_type_node, arg);
}
else if (NULLPTR_TYPE_P (arg_type))
- arg = null_pointer_node;
+ {
+ if (TREE_SIDE_EFFECTS (arg))
+ arg = cp_build_compound_expr (arg, null_pointer_node, complain);
+ else
+ arg = null_pointer_node;
+ }
else if (INTEGRAL_OR_ENUMERATION_TYPE_P (arg_type))
{
if (SCOPED_ENUM_P (arg_type))
+2019-12-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/92992
+ * g++.dg/cpp0x/nullptr45.C: New test.
+
2019-12-20 Jonathan Wakely <jwakely@redhat.com>
PR fortran/69497
--- /dev/null
+// PR c++/92992
+// { dg-do run { target c++11 } }
+
+int a;
+
+void
+bar (int, ...)
+{
+}
+
+decltype (nullptr)
+baz ()
+{
+ a++;
+ return nullptr;
+}
+
+int
+main ()
+{
+ bar (0, baz ());
+ if (a != 1)
+ __builtin_abort ();
+}