Skip to content

Commit

Permalink
if constexpr since C++17
Browse files Browse the repository at this point in the history
  • Loading branch information
Advenam Tacet committed Dec 22, 2023
1 parent 418cdd7 commit 629e007
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libcxx/include/deque
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,7 @@ private:
_LIBCPP_HIDE_FROM_ABI void __annotate_delete() const _NOEXCEPT {
#ifndef _LIBCPP_HAS_NO_ASAN
// The default allocator does not require unpoisoning before returning memory.
if _LIBCPP_CONSTEXPR (is_same<allocator_type, allocator<_Tp> >::value)
if _LIBCPP_CONSTEXPR_SINCE_CXX17 (is_same<allocator_type, allocator<_Tp> >::value)
return;
if (empty()) {
for (size_t __i = 0; __i < __map_.size(); ++__i) {
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/string
Original file line number Diff line number Diff line change
Expand Up @@ -1913,7 +1913,7 @@ private:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __annotate_delete() const _NOEXCEPT {
#if !defined(_LIBCPP_HAS_NO_ASAN) && defined(_LIBCPP_INSTRUMENTED_WITH_ASAN)
// The default allocator does not require unpoisoning before returning memory.
if _LIBCPP_CONSTEXPR (!is_same<allocator_type, allocator<__default_allocator_type> >::value)
if _LIBCPP_CONSTEXPR_SINCE_CXX17 (!is_same<allocator_type, allocator<__default_allocator_type> >::value)
if (!__libcpp_is_constant_evaluated() && (__asan_short_string_is_annotated() || __is_long()))
__annotate_contiguous_container(data() + size() + 1, data() + capacity() + 1);
#endif
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/vector
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ private:
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __annotate_delete() const _NOEXCEPT {
#ifndef _LIBCPP_HAS_NO_ASAN
// The default allocator does not require unpoisoning before returning memory.
if _LIBCPP_CONSTEXPR (!is_same<allocator_type, __default_allocator_type>::value)
if _LIBCPP_CONSTEXPR_SINCE_CXX17 (!is_same<allocator_type, __default_allocator_type>::value)
__annotate_contiguous_container(data(), data() + capacity(), data() + size(), data() + capacity());
#endif
}
Expand Down

0 comments on commit 629e007

Please sign in to comment.