]> gcc.gnu.org Git - gcc.git/commit - gcc/cp/constexpr.cc
PR c++/67376 - [5/6 regression] Comparison with pointer to past-the-end
authorMartin Sebor <msebor@redhat.com>
Sat, 2 Apr 2016 17:14:48 +0000 (17:14 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Sat, 2 Apr 2016 17:14:48 +0000 (11:14 -0600)
commitabdc16c867080c5bd4dbbce2caf0d08e729255a0
treef504219a5a11f02c14411065cc894e05404ff4ce
parent7d9979e629a54f0d7e3378c90c7eb1adfd76196e
PR c++/67376 - [5/6 regression] Comparison with pointer to past-the-end

PR c++/67376 - [5/6 regression] Comparison with pointer to past-the-end
        of array fails inside constant expression
PR c++/70170 - [6 regression] bogus not a constant expression error comparing
        pointer to array to null
PR c++/70172 - incorrect reinterpret_cast from integer to pointer error
        on invalid constexpr initialization
PR c++/70228 - insufficient detail in diagnostics for a constexpr out of bounds
        array subscript

gcc/testsuite/ChangeLog:
2016-04-02  Martin Sebor  <msebor@redhat.com>

        PR c++/67376
        PR c++/70170
        PR c++/70172
        PR c++/70228
        * g++.dg/cpp0x/constexpr-array-ptr10.C: New test.
        * g++.dg/cpp0x/constexpr-array-ptr9.C: New test.
        * g++.dg/cpp0x/constexpr-nullptr-1.C: New test.
        * g++.dg/cpp0x/constexpr-array5.C: Adjust text of expected diagnostic.
        * g++.dg/cpp0x/constexpr-string.C: Same.
        * g++.dg/cpp0x/constexpr-wstring2.C: Same.
        * g++.dg/cpp0x/pr65398.C: Same.
        * g++.dg/ext/constexpr-vla1.C: Same.
        * g++.dg/ext/constexpr-vla2.C: Same.
        * g++.dg/ext/constexpr-vla3.C: Same.
        * g++.dg/ubsan/pr63956.C: Same.

gcc/cp/ChangeLog:
2016-04-02  Martin Sebor  <msebor@redhat.com>

        PR c++/67376
        PR c++/70170
        PR c++/70172
        PR c++/70228
        * constexpr.c (diag_array_subscript): New function.
        (cxx_eval_array_reference): Detect out of bounds array indices.

gcc/ChangeLog:
2016-04-02  Martin Sebor  <msebor@redhat.com>

        PR c++/67376
        * fold-const.c (maybe_nonzero_address): New function.
        (fold_comparison): Call it.  Fold equality and relational
        expressions involving null pointers.
        (tree_single_nonzero_warnv_p): Call maybe_nonzero_address.

From-SVN: r234698
16 files changed:
gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/constexpr-array-ptr10.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-array-ptr9.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-array5.C
gcc/testsuite/g++.dg/cpp0x/constexpr-nullptr-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-string.C
gcc/testsuite/g++.dg/cpp0x/constexpr-wstring2.C
gcc/testsuite/g++.dg/cpp0x/pr65398.C
gcc/testsuite/g++.dg/ext/constexpr-vla1.C
gcc/testsuite/g++.dg/ext/constexpr-vla2.C
gcc/testsuite/g++.dg/ext/constexpr-vla3.C
gcc/testsuite/g++.dg/ubsan/pr63956.C
This page took 0.073414 seconds and 5 git commands to generate.