Skip to content

[libc++] Qualify calls to nullary functions like __throw_foo #122465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libcxx/docs/CodingGuidelines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Function overloading also applies to operators. Using ``&user_object`` may call
...
}

This is mostly enforced by the clang-tidy checks ``libcpp-robust-against-adl`` and ``libcpp-qualify-declval``.
This is mostly enforced by the clang-tidy check ``libcpp-robust-against-adl``.

Avoid including public headers
==============================
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__algorithm/ranges_iterator_concept.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ consteval auto __get_iterator_concept() {
}

template <class _Iter>
using __iterator_concept _LIBCPP_NODEBUG = decltype(__get_iterator_concept<_Iter>());
using __iterator_concept _LIBCPP_NODEBUG = decltype(ranges::__get_iterator_concept<_Iter>());

} // namespace ranges
_LIBCPP_END_NAMESPACE_STD
Expand Down
4 changes: 2 additions & 2 deletions libcxx/include/__algorithm/stable_sort.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 void __stable_sort(
is_integral_v<value_type > && is_same_v< value_type&, __iter_reference<_RandomAccessIterator>>;
constexpr auto __allowed_radix_sort = __default_comp && __integral_value;
if constexpr (__allowed_radix_sort) {
if (__len <= __buff_size && __len >= static_cast<difference_type>(__radix_sort_min_bound<value_type>()) &&
__len <= static_cast<difference_type>(__radix_sort_max_bound<value_type>())) {
if (__len <= __buff_size && __len >= static_cast<difference_type>(std::__radix_sort_min_bound<value_type>()) &&
__len <= static_cast<difference_type>(std::__radix_sort_max_bound<value_type>())) {
if (__libcpp_is_constant_evaluated()) {
for (auto* __p = __buff; __p < __buff + __buff_size; ++__p) {
std::__construct_at(__p);
Expand Down
4 changes: 2 additions & 2 deletions libcxx/include/__chrono/formatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ _LIBCPP_HIDE_FROM_ABI void __format_chrono_using_chrono_specs(
case _CharT('T'):
__facet.put(
{__sstr}, __sstr, _CharT(' '), std::addressof(__t), std::to_address(__s), std::to_address(__it + 1));
if constexpr (__use_fraction<_Tp>())
if constexpr (__formatter::__use_fraction<_Tp>())
__formatter::__format_sub_seconds(__sstr, __value);
break;

Expand Down Expand Up @@ -378,7 +378,7 @@ _LIBCPP_HIDE_FROM_ABI void __format_chrono_using_chrono_specs(
break;

case _CharT('O'):
if constexpr (__use_fraction<_Tp>()) {
if constexpr (__formatter::__use_fraction<_Tp>()) {
// Handle OS using the normal representation for the non-fractional
// part. There seems to be no locale information regarding how the
// fractional part should be formatted.
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__compare/common_comparison_category.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ __compute_comp_type(const _ClassifyCompCategory (&__types)[_Size]) {
template <class... _Ts, bool _False = false>
_LIBCPP_HIDE_FROM_ABI constexpr auto __get_comp_type() {
using _CCC = _ClassifyCompCategory;
constexpr _CCC __type_kinds[] = {_StrongOrd, __type_to_enum<_Ts>()...};
constexpr _CCC __type_kinds[] = {_StrongOrd, __comp_detail::__type_to_enum<_Ts>()...};
constexpr _CCC __cat = __comp_detail::__compute_comp_type(__type_kinds);
if constexpr (__cat == _None)
return void();
Expand Down
4 changes: 2 additions & 2 deletions libcxx/include/__condition_variable/condition_variable.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ inline void condition_variable::__do_timed_wait(
unique_lock<mutex>& __lk, chrono::time_point<chrono::steady_clock, chrono::nanoseconds> __tp) _NOEXCEPT {
using namespace chrono;
if (!__lk.owns_lock())
__throw_system_error(EPERM, "condition_variable::timed wait: mutex not locked");
std::__throw_system_error(EPERM, "condition_variable::timed wait: mutex not locked");
nanoseconds __d = __tp.time_since_epoch();
timespec __ts;
seconds __s = duration_cast<seconds>(__d);
Expand All @@ -225,7 +225,7 @@ inline void condition_variable::__do_timed_wait(
}
int __ec = pthread_cond_clockwait(&__cv_, __lk.mutex()->native_handle(), CLOCK_MONOTONIC, &__ts);
if (__ec != 0 && __ec != ETIMEDOUT)
__throw_system_error(__ec, "condition_variable timed_wait failed");
std::__throw_system_error(__ec, "condition_variable timed_wait failed");
}
# endif // _LIBCPP_HAS_COND_CLOCKWAIT

Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__filesystem/directory_entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ class directory_entry {
return;
}
if (__ec && (!__allow_dne || !__is_dne_error(__ec)))
__throw_filesystem_error(__msg, __p_, __ec);
filesystem::__throw_filesystem_error(__msg, __p_, __ec);
}

_LIBCPP_HIDE_FROM_ABI void __refresh(error_code* __ec = nullptr) {
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__format/format_arg_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ consteval __arg_t __determine_arg_t() {
template <class _Context, class _Tp>
_LIBCPP_HIDE_FROM_ABI basic_format_arg<_Context> __create_format_arg(_Tp& __value) noexcept {
using _Dp = remove_const_t<_Tp>;
constexpr __arg_t __arg = __determine_arg_t<_Context, _Dp>();
constexpr __arg_t __arg = __format::__determine_arg_t<_Context, _Dp>();
static_assert(__arg != __arg_t::__none, "the supplied type is not formattable");
static_assert(__formattable_with<_Tp, _Context>);

Expand Down
4 changes: 2 additions & 2 deletions libcxx/include/__functional/function.h
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ class __value_func<_Rp(_ArgTypes...)> {

_LIBCPP_HIDE_FROM_ABI _Rp operator()(_ArgTypes&&... __args) const {
if (__f_ == nullptr)
__throw_bad_function_call();
std::__throw_bad_function_call();
return (*__f_)(std::forward<_ArgTypes>(__args)...);
}

Expand Down Expand Up @@ -607,7 +607,7 @@ struct __policy_invoker<_Rp(_ArgTypes...)> {
_LIBCPP_HIDE_FROM_ABI explicit __policy_invoker(__Call __c) : __call_(__c) {}

_LIBCPP_HIDE_FROM_ABI static _Rp __call_empty(const __policy_storage*, __fast_forward<_ArgTypes>...) {
__throw_bad_function_call();
std::__throw_bad_function_call();
}

template <typename _Fun>
Expand Down
10 changes: 5 additions & 5 deletions libcxx/include/__locale
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ inline _LIBCPP_HIDE_FROM_ABI locale::locale(const locale& __other, _Facet* __f)
template <class _Facet>
locale locale::combine(const locale& __other) const {
if (!std::has_facet<_Facet>(__other))
__throw_runtime_error("locale::combine: locale missing facet");
std::__throw_runtime_error("locale::combine: locale missing facet");

return locale(*this, &const_cast<_Facet&>(std::use_facet<_Facet>(__other)));
}
Expand Down Expand Up @@ -1298,7 +1298,7 @@ struct _LIBCPP_EXPORTED_FROM_ABI __narrow_to_utf8<16> : public codecvt<char16_t,
const char16_t* __wn = (const char16_t*)__wb;
__r = do_out(__mb, (const char16_t*)__wb, (const char16_t*)__we, __wn, __buf, __buf + __sz, __bn);
if (__r == codecvt_base::error || __wn == (const char16_t*)__wb)
__throw_runtime_error("locale not supported");
std::__throw_runtime_error("locale not supported");
for (const char* __p = __buf; __p < __bn; ++__p, ++__s)
*__s = *__p;
__wb = (const _CharT*)__wn;
Expand Down Expand Up @@ -1326,7 +1326,7 @@ struct _LIBCPP_EXPORTED_FROM_ABI __narrow_to_utf8<32> : public codecvt<char32_t,
const char32_t* __wn = (const char32_t*)__wb;
__r = do_out(__mb, (const char32_t*)__wb, (const char32_t*)__we, __wn, __buf, __buf + __sz, __bn);
if (__r == codecvt_base::error || __wn == (const char32_t*)__wb)
__throw_runtime_error("locale not supported");
std::__throw_runtime_error("locale not supported");
for (const char* __p = __buf; __p < __bn; ++__p, ++__s)
*__s = *__p;
__wb = (const _CharT*)__wn;
Expand Down Expand Up @@ -1370,7 +1370,7 @@ struct _LIBCPP_EXPORTED_FROM_ABI __widen_from_utf8<16> : public codecvt<char16_t
const char* __nn = __nb;
__r = do_in(__mb, __nb, __ne - __nb > __sz ? __nb + __sz : __ne, __nn, __buf, __buf + __sz, __bn);
if (__r == codecvt_base::error || __nn == __nb)
__throw_runtime_error("locale not supported");
std::__throw_runtime_error("locale not supported");
for (const char16_t* __p = __buf; __p < __bn; ++__p, ++__s)
*__s = *__p;
__nb = __nn;
Expand Down Expand Up @@ -1398,7 +1398,7 @@ struct _LIBCPP_EXPORTED_FROM_ABI __widen_from_utf8<32> : public codecvt<char32_t
const char* __nn = __nb;
__r = do_in(__mb, __nb, __ne - __nb > __sz ? __nb + __sz : __ne, __nn, __buf, __buf + __sz, __bn);
if (__r == codecvt_base::error || __nn == __nb)
__throw_runtime_error("locale not supported");
std::__throw_runtime_error("locale not supported");
for (const char32_t* __p = __buf; __p < __bn; ++__p, ++__s)
*__s = *__p;
__nb = __nn;
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__locale_dir/support/windows.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ struct __locale_guard {
if (std::strcmp(__l.__get_locale(), __lc) != 0) {
__locale_all = _strdup(__lc);
if (__locale_all == nullptr)
__throw_bad_alloc();
std::__throw_bad_alloc();
__locale::__setlocale(LC_ALL, __l.__get_locale());
}
}
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__memory/allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class _LIBCPP_TEMPLATE_VIS allocator : private __non_trivial_if<!is_void<_Tp>::v
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp* allocate(size_t __n) {
static_assert(sizeof(_Tp) >= 0, "cannot allocate memory for an incomplete type");
if (__n > allocator_traits<allocator>::max_size(*this))
__throw_bad_array_new_length();
std::__throw_bad_array_new_length();
if (__libcpp_is_constant_evaluated()) {
return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp)));
} else {
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__memory/shared_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr {
_LIBCPP_HIDE_FROM_ABI explicit shared_ptr(const weak_ptr<_Yp>& __r)
: __ptr_(__r.__ptr_), __cntrl_(__r.__cntrl_ ? __r.__cntrl_->lock() : __r.__cntrl_) {
if (__cntrl_ == nullptr)
__throw_bad_weak_ptr();
std::__throw_bad_weak_ptr();
}

#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__memory_resource/polymorphic_allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class _LIBCPP_AVAILABILITY_PMR _LIBCPP_TEMPLATE_VIS polymorphic_allocator {

[[nodiscard]] _LIBCPP_HIDE_FROM_ABI _ValueType* allocate(size_t __n) {
if (__n > __max_size()) {
__throw_bad_array_new_length();
std::__throw_bad_array_new_length();
}
return static_cast<_ValueType*>(__res_->allocate(__n * sizeof(_ValueType), alignof(_ValueType)));
}
Expand Down
18 changes: 9 additions & 9 deletions libcxx/include/__mutex/unique_lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,19 @@ _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(unique_lock);
template <class _Mutex>
_LIBCPP_HIDE_FROM_ABI void unique_lock<_Mutex>::lock() {
if (__m_ == nullptr)
__throw_system_error(EPERM, "unique_lock::lock: references null mutex");
std::__throw_system_error(EPERM, "unique_lock::lock: references null mutex");
if (__owns_)
__throw_system_error(EDEADLK, "unique_lock::lock: already locked");
std::__throw_system_error(EDEADLK, "unique_lock::lock: already locked");
__m_->lock();
__owns_ = true;
}

template <class _Mutex>
_LIBCPP_HIDE_FROM_ABI bool unique_lock<_Mutex>::try_lock() {
if (__m_ == nullptr)
__throw_system_error(EPERM, "unique_lock::try_lock: references null mutex");
std::__throw_system_error(EPERM, "unique_lock::try_lock: references null mutex");
if (__owns_)
__throw_system_error(EDEADLK, "unique_lock::try_lock: already locked");
std::__throw_system_error(EDEADLK, "unique_lock::try_lock: already locked");
__owns_ = __m_->try_lock();
return __owns_;
}
Expand All @@ -137,9 +137,9 @@ template <class _Mutex>
template <class _Rep, class _Period>
_LIBCPP_HIDE_FROM_ABI bool unique_lock<_Mutex>::try_lock_for(const chrono::duration<_Rep, _Period>& __d) {
if (__m_ == nullptr)
__throw_system_error(EPERM, "unique_lock::try_lock_for: references null mutex");
std::__throw_system_error(EPERM, "unique_lock::try_lock_for: references null mutex");
if (__owns_)
__throw_system_error(EDEADLK, "unique_lock::try_lock_for: already locked");
std::__throw_system_error(EDEADLK, "unique_lock::try_lock_for: already locked");
__owns_ = __m_->try_lock_for(__d);
return __owns_;
}
Expand All @@ -148,17 +148,17 @@ template <class _Mutex>
template <class _Clock, class _Duration>
_LIBCPP_HIDE_FROM_ABI bool unique_lock<_Mutex>::try_lock_until(const chrono::time_point<_Clock, _Duration>& __t) {
if (__m_ == nullptr)
__throw_system_error(EPERM, "unique_lock::try_lock_until: references null mutex");
std::__throw_system_error(EPERM, "unique_lock::try_lock_until: references null mutex");
if (__owns_)
__throw_system_error(EDEADLK, "unique_lock::try_lock_until: already locked");
std::__throw_system_error(EDEADLK, "unique_lock::try_lock_until: already locked");
__owns_ = __m_->try_lock_until(__t);
return __owns_;
}

template <class _Mutex>
_LIBCPP_HIDE_FROM_ABI void unique_lock<_Mutex>::unlock() {
if (!__owns_)
__throw_system_error(EPERM, "unique_lock::unlock: not locked");
std::__throw_system_error(EPERM, "unique_lock::unlock: not locked");
__m_->unlock();
__owns_ = false;
}
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__ostream/basic_ostream.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const char* __strn) {
if (__len > __bs) {
__wb = (_CharT*)malloc(__len * sizeof(_CharT));
if (__wb == 0)
__throw_bad_alloc();
std::__throw_bad_alloc();
__h.reset(__wb);
}
for (_CharT* __p = __wb; *__strn != '\0'; ++__strn, ++__p)
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__random/clamp_to_integral.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _IntT __max_representable_int_for_float(
template <class _IntT, class _RealT>
_LIBCPP_HIDE_FROM_ABI _IntT __clamp_to_integral(_RealT __r) _NOEXCEPT {
using _Lim = numeric_limits<_IntT>;
const _IntT __max_val = __max_representable_int_for_float<_IntT, _RealT>();
const _IntT __max_val = std::__max_representable_int_for_float<_IntT, _RealT>();
if (__r >= ::nextafter(static_cast<_RealT>(__max_val), INFINITY)) {
return _Lim::max();
} else if (__r <= _Lim::lowest()) {
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__ranges/elements_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class elements_view<_View, _Np>::__iterator
}

public:
using iterator_concept = decltype(__get_iterator_concept());
using iterator_concept = decltype(__iterator::__get_iterator_concept());
using value_type = remove_cvref_t<tuple_element_t<_Np, range_value_t<_Base>>>;
using difference_type = range_difference_t<_Base>;

Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__ranges/zip_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ class zip_view<_Views...>::__iterator : public __zip_view_iterator_category_base
friend class zip_view<_Views...>;

public:
using iterator_concept = decltype(__get_zip_view_iterator_tag<_Const, _Views...>());
using iterator_concept = decltype(ranges::__get_zip_view_iterator_tag<_Const, _Views...>());
using value_type = tuple<range_value_t<__maybe_const<_Const, _Views>>...>;
using difference_type = common_type_t<range_difference_t<__maybe_const<_Const, _Views>>...>;

Expand Down
6 changes: 3 additions & 3 deletions libcxx/include/__thread/thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ template <class _Tp>
__thread_specific_ptr<_Tp>::__thread_specific_ptr() {
int __ec = __libcpp_tls_create(&__key_, &__thread_specific_ptr::__at_thread_exit);
if (__ec)
__throw_system_error(__ec, "__thread_specific_ptr construction failed");
std::__throw_system_error(__ec, "__thread_specific_ptr construction failed");
}

template <class _Tp>
Expand Down Expand Up @@ -219,7 +219,7 @@ thread::thread(_Fp&& __f, _Args&&... __args) {
if (__ec == 0)
__p.release();
else
__throw_system_error(__ec, "thread constructor failed");
std::__throw_system_error(__ec, "thread constructor failed");
}

# else // _LIBCPP_CXX03_LANG
Expand Down Expand Up @@ -251,7 +251,7 @@ thread::thread(_Fp __f) {
if (__ec == 0)
__pp.release();
else
__throw_system_error(__ec, "thread constructor failed");
std::__throw_system_error(__ec, "thread constructor failed");
}

# endif // _LIBCPP_CXX03_LANG
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__type_traits/is_nothrow_convertible.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ template <typename _Fm, typename _To>
bool_constant<noexcept(std::__test_noexcept<_To>(std::declval<_Fm>()))> __is_nothrow_convertible_test();

template <typename _Fm, typename _To>
struct __is_nothrow_convertible_helper : decltype(__is_nothrow_convertible_test<_Fm, _To>()) {};
struct __is_nothrow_convertible_helper : decltype(std::__is_nothrow_convertible_test<_Fm, _To>()) {};

template <typename _Fm, typename _To>
struct is_nothrow_convertible
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__vector/vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ class _LIBCPP_TEMPLATE_VIS vector {
// Postcondition: size() == 0
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __vallocate(size_type __n) {
if (__n > max_size())
__throw_length_error();
this->__throw_length_error();
auto __allocation = std::__allocate_at_least(this->__alloc_, __n);
__begin_ = __allocation.ptr;
__end_ = __allocation.ptr;
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__vector/vector_bool.h
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ class _LIBCPP_TEMPLATE_VIS vector<bool, _Allocator> {
// Postcondition: size() == 0
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __vallocate(size_type __n) {
if (__n > max_size())
__throw_length_error();
this->__throw_length_error();
auto __allocation = std::__allocate_at_least(__alloc_, __external_cap_to_internal(__n));
__begin_ = __allocation.ptr;
__size_ = 0;
Expand Down
6 changes: 3 additions & 3 deletions libcxx/include/any
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST _ValueType
"or a CopyConstructible type");
auto __tmp = std::any_cast<add_const_t<_RawValueType>>(&__v);
if (__tmp == nullptr)
__throw_bad_any_cast();
std::__throw_bad_any_cast();
return static_cast<_ValueType>(*__tmp);
}

Expand All @@ -538,7 +538,7 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST _ValueType
"or a CopyConstructible type");
auto __tmp = std::any_cast<_RawValueType>(&__v);
if (__tmp == nullptr)
__throw_bad_any_cast();
std::__throw_bad_any_cast();
return static_cast<_ValueType>(*__tmp);
}

Expand All @@ -550,7 +550,7 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST _ValueType
"or a CopyConstructible type");
auto __tmp = std::any_cast<_RawValueType>(&__v);
if (__tmp == nullptr)
__throw_bad_any_cast();
std::__throw_bad_any_cast();
return static_cast<_ValueType>(std::move(*__tmp));
}

Expand Down
8 changes: 4 additions & 4 deletions libcxx/include/array
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,13 @@ struct _LIBCPP_TEMPLATE_VIS array {

_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference at(size_type __n) {
if (__n >= _Size)
__throw_out_of_range("array::at");
std::__throw_out_of_range("array::at");
return __elems_[__n];
}

_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference at(size_type __n) const {
if (__n >= _Size)
__throw_out_of_range("array::at");
std::__throw_out_of_range("array::at");
return __elems_[__n];
}

Expand Down Expand Up @@ -407,12 +407,12 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0> {
}

_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference at(size_type) {
__throw_out_of_range("array<T, 0>::at");
std::__throw_out_of_range("array<T, 0>::at");
__libcpp_unreachable();
}

_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference at(size_type) const {
__throw_out_of_range("array<T, 0>::at");
std::__throw_out_of_range("array<T, 0>::at");
__libcpp_unreachable();
}

Expand Down
Loading