aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-range-cache.h
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2024-06-18 20:57:13 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2024-06-27 09:39:40 +0100
commitcfc9fa3bdddc1af59b7854937b99516067fd8c63 (patch)
tree6297592e2bd78f43b084ad4e2550063ff5a24c01 /gcc/gimple-range-cache.h
parent5c8b7fcc04b1ec412e11ae3d77f704c19a63ab07 (diff)
downloadgcc-cfc9fa3bdddc1af59b7854937b99516067fd8c63.zip
gcc-cfc9fa3bdddc1af59b7854937b99516067fd8c63.tar.gz
gcc-cfc9fa3bdddc1af59b7854937b99516067fd8c63.tar.bz2
libstdc++: Enable more debug assertions during constant evaluation [PR111250]
Some of our debug assertions expand to nothing unless _GLIBCXX_ASSERTIONS is defined, which means they are not checked during constant evaluation. By making them unconditionally expand to a __glibcxx_assert expression they will be checked during constant evaluation. This allows us to diagnose more instances of undefined behaviour at compile-time, such as accessing a vector past-the-end. libstdc++-v3/ChangeLog: PR libstdc++/111250 * include/debug/assertions.h (__glibcxx_requires_non_empty_range) (__glibcxx_requires_nonempty, __glibcxx_requires_subscript): Define to __glibcxx_assert expressions or to debug mode __glibcxx_check_xxx expressions. * testsuite/23_containers/array/element_access/constexpr_c++17.cc: Add checks for out-of-bounds accesses in constant expressions. * testsuite/23_containers/vector/element_access/constexpr.cc: Likewise.
Diffstat (limited to 'gcc/gimple-range-cache.h')
0 files changed, 0 insertions, 0 deletions