PR c++/90473 - wrong code with nullptr in default argument.
authorMarek Polacek <polacek@redhat.com>
Tue, 13 Aug 2019 15:05:48 +0000 (15:05 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Tue, 13 Aug 2019 15:05:48 +0000 (15:05 +0000)
commitcb0a83f3437be73075fba17db68abbf240d17a36
tree0697b0b4e87b5dc7ddb5c05fad90bdad5eaeccad
parent82614ffbfdb57dcc490a752f0d398bbe2a774864
PR c++/90473 - wrong code with nullptr in default argument.

* call.c (null_ptr_cst_p): Update quote from the standard.
* decl.c (check_default_argument): Don't return nullptr when the arg
has side-effects.

* g++.dg/cpp0x/nullptr42.C: New test.

From-SVN: r274382
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/nullptr42.C [new file with mode: 0644]