constexpr-sfinae.C
7.48 KB
-
PR c++/60760 - arithmetic on null pointers should not be allowed in constant · 8bada5cd
PR c++/60760 - arithmetic on null pointers should not be allowed in constant PR c++/71091 - constexpr reference bound to a null pointer dereference gcc/cp/ChangeLog: PR c++/60760 PR c++/71091 * constexpr.c (cxx_eval_binary_expression): Reject invalid expressions involving null pointers. (cxx_eval_component_reference): Reject null pointer dereferences. (cxx_eval_indirect_ref): Reject indirecting through null pointers. (cxx_eval_constant_expression): Reject invalid expressions involving null pointers. gcc/testsuite/ChangeLog: PR c++/60760 PR c++/71091 * g++.dg/cpp0x/constexpr-cast.C: New test. * g++.dg/cpp0x/constexpr-nullptr-2.C: New test. * g++.dg/cpp1y/constexpr-sfinae.C: Correct. * g++.dg/ubsan/pr63956.C: Correct. From-SVN: r238909
Martin Sebor committed