PR c++/86738
commit2b1749c4ab52eda4733612528f612f756546c312
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Aug 2018 08:31:40 +0000 (8 08:31 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Aug 2018 08:31:40 +0000 (8 08:31 +0000)
treef6a530fb390a2247b815a755871606b62181913b
parentc36feda9d1bbd790cdee3d26feadade120a90c1e
PR c++/86738
* constexpr.c (cxx_eval_binary_expression): For arithmetics involving
NULL pointer set *non_constant_p to true.
(cxx_eval_component_reference): For dereferencing of a NULL pointer,
set *non_constant_p to true and return t.

* g++.dg/opt/pr86738.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263390 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/pr86738.C [new file with mode: 0644]