8sa1-gcc/gcc/testsuite/g++.dg/cpp0x/nullptr45.C
Jakub Jelinek 6c7b84305a re PR c++/92992 (Side-effects dropped when decltype(nullptr) typed expression is passed to ellipsis)
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-21 00:15:52 +01:00

25 lines
213 B
C

// 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 ();
}