Skip to content

Commit 2dc7499

Browse files
committed
try once again to silence apple-clang warning
1 parent bbfec6b commit 2dc7499

File tree

5 files changed

+100
-65
lines changed

5 files changed

+100
-65
lines changed

include/concepts/swap.hpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#endif
2929

3030
#ifndef CPP_CXX_INLINE_VARIABLES
31-
#ifdef __cpp_inline_variables // TODO: fix this if SD-6 picks another name
31+
#ifdef __cpp_inline_variables
3232
#define CPP_CXX_INLINE_VARIABLES __cpp_inline_variables
3333
// TODO: remove once clang defines __cpp_inline_variables (or equivalent)
3434
#elif defined(__clang__) && \
@@ -124,8 +124,11 @@ namespace concepts
124124
{
125125
static constexpr T const value {};
126126
};
127+
128+
#if CPP_CXX_INLINE_VARIABLES < 201606L
127129
template<typename T>
128130
constexpr T const static_const<T>::value;
131+
#endif
129132
}
130133
/// \endcond
131134

include/meta/meta.hpp

+7-5
Original file line numberDiff line numberDiff line change
@@ -2835,12 +2835,14 @@ namespace meta
28352835
template <typename T>
28362836
struct static_const
28372837
{
2838-
static constexpr T value{};
2838+
static constexpr T const value{};
28392839
};
28402840

2841+
#if !META_CXX_INLINE_VARIABLES
28412842
// Avoid potential ODR violations with global objects:
2842-
template <typename T>
2843-
constexpr T static_const<T>::value;
2843+
template<typename T>
2844+
constexpr T const static_const<T>::value;
2845+
#endif
28442846
} // namespace detail
28452847

28462848
///\endcond
@@ -3776,9 +3778,9 @@ namespace meta
37763778
{
37773779
/// A user-defined literal that generates objects of type \c meta::size_t.
37783780
/// \ingroup integral
3779-
template <char... Chs>
3781+
template<char... Chs>
37803782
constexpr fold<list<char_<Chs>...>, meta::size_t<0>, quote<detail::atoi_>>
3781-
operator"" _z()
3783+
operator""_z()
37823784
{
37833785
return {};
37843786
}

include/range/v3/detail/prologue.hpp

-4
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,3 @@ RANGES_DIAGNOSTIC_KEYWORD_MACRO
4848

4949
#pragma push_macro("I")
5050
#undef I
51-
52-
#if defined(__apple_build_version__)
53-
RANGES_DIAGNOSTIC_IGNORE("-Wdeprecated")
54-
#endif

include/range/v3/iterator/diffmax_t.hpp

+83-52
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,85 @@ namespace ranges
347347
template<typename Enable>
348348
constexpr bool _is_integer_like_<diffmax_t, Enable> = true;
349349
#endif
350+
351+
template<bool = true>
352+
struct diffmax_numeric_limits
353+
{
354+
static constexpr bool const is_specialized = true;
355+
static constexpr bool const is_signed = true;
356+
static constexpr bool const is_integer = true;
357+
static constexpr bool const is_exact = true;
358+
static constexpr bool const has_infinity = false;
359+
static constexpr bool const has_quiet_NaN = false;
360+
static constexpr bool const has_signaling_NaN = false;
361+
static constexpr bool const has_denorm = false;
362+
static constexpr bool const has_denorm_loss = false;
363+
static constexpr std::float_round_style const round_style =
364+
std::round_toward_zero;
365+
static constexpr bool const is_iec559 = false;
366+
static constexpr bool const is_bounded = true;
367+
static constexpr bool const is_modulo = false;
368+
static constexpr int const digits = CHAR_BIT * sizeof(std::uintmax_t) + 1;
369+
static constexpr int const digits10 =
370+
static_cast<int>(digits * 0.301029996); // digits * std::log10(2)
371+
static constexpr int const max_digits10 = 0;
372+
static constexpr int const radix = 2;
373+
static constexpr int const min_exponent = 0;
374+
static constexpr int const min_exponent10 = 0;
375+
static constexpr int const max_exponent = 0;
376+
static constexpr int const max_exponent10 = 0;
377+
static constexpr bool const traps = true;
378+
static constexpr bool const tinyness_before = false;
379+
};
380+
381+
#if RANGES_CXX_INLINE_VARIABLES < RANGES_CXX_INLINE_VARIABLES_17
382+
template<bool B>
383+
constexpr bool const diffmax_numeric_limits<B>::is_specialized;
384+
template<bool B>
385+
constexpr bool const diffmax_numeric_limits<B>::is_signed;
386+
template<bool B>
387+
constexpr bool const diffmax_numeric_limits<B>::is_integer;
388+
template<bool B>
389+
constexpr bool const diffmax_numeric_limits<B>::is_exact;
390+
template<bool B>
391+
constexpr bool const diffmax_numeric_limits<B>::has_infinity;
392+
template<bool B>
393+
constexpr bool const diffmax_numeric_limits<B>::has_quiet_NaN;
394+
template<bool B>
395+
constexpr bool const diffmax_numeric_limits<B>::has_signaling_NaN;
396+
template<bool B>
397+
constexpr bool const diffmax_numeric_limits<B>::has_denorm;
398+
template<bool B>
399+
constexpr bool const diffmax_numeric_limits<B>::has_denorm_loss;
400+
template<bool B>
401+
constexpr std::float_round_style const diffmax_numeric_limits<B>::round_style;
402+
template<bool B>
403+
constexpr bool const diffmax_numeric_limits<B>::is_iec559;
404+
template<bool B>
405+
constexpr bool const diffmax_numeric_limits<B>::is_bounded;
406+
template<bool B>
407+
constexpr bool const diffmax_numeric_limits<B>::is_modulo;
408+
template<bool B>
409+
constexpr int const diffmax_numeric_limits<B>::digits;
410+
template<bool B>
411+
constexpr int const diffmax_numeric_limits<B>::digits10;
412+
template<bool B>
413+
constexpr int const diffmax_numeric_limits<B>::max_digits10;
414+
template<bool B>
415+
constexpr int const diffmax_numeric_limits<B>::radix;
416+
template<bool B>
417+
constexpr int const diffmax_numeric_limits<B>::min_exponent;
418+
template<bool B>
419+
constexpr int const diffmax_numeric_limits<B>::min_exponent10;
420+
template<bool B>
421+
constexpr int const diffmax_numeric_limits<B>::max_exponent;
422+
template<bool B>
423+
constexpr int const diffmax_numeric_limits<B>::max_exponent10;
424+
template<bool B>
425+
constexpr bool const diffmax_numeric_limits<B>::traps;
426+
template<bool B>
427+
constexpr bool const diffmax_numeric_limits<B>::tinyness_before;
428+
#endif
350429
} // namespace detail
351430
/// \endcond
352431
} // namespace ranges
@@ -358,32 +437,8 @@ namespace std
358437
{
359438
template<>
360439
struct numeric_limits<::ranges::detail::diffmax_t>
440+
: ::ranges::detail::diffmax_numeric_limits<>
361441
{
362-
static constexpr bool is_specialized = true;
363-
static constexpr bool is_signed = true;
364-
static constexpr bool is_integer = true;
365-
static constexpr bool is_exact = true;
366-
static constexpr bool has_infinity = false;
367-
static constexpr bool has_quiet_NaN = false;
368-
static constexpr bool has_signaling_NaN = false;
369-
static constexpr bool has_denorm = false;
370-
static constexpr bool has_denorm_loss = false;
371-
static constexpr std::float_round_style round_style = std::round_toward_zero;
372-
static constexpr bool is_iec559 = false;
373-
static constexpr bool is_bounded = true;
374-
static constexpr bool is_modulo = false;
375-
static constexpr int digits = CHAR_BIT * sizeof(std::uintmax_t) + 1;
376-
static constexpr int digits10 =
377-
static_cast<int>(digits * 0.301029996); // digits * std::log10(2)
378-
static constexpr int max_digits10 = 0;
379-
static constexpr int radix = 2;
380-
static constexpr int min_exponent = 0;
381-
static constexpr int min_exponent10 = 0;
382-
static constexpr int max_exponent = 0;
383-
static constexpr int max_exponent10 = 0;
384-
static constexpr bool traps = true;
385-
static constexpr bool tinyness_before = false;
386-
387442
static constexpr ::ranges::detail::diffmax_t max() noexcept
388443
{
389444
return std::uintmax_t(-1);
@@ -421,45 +476,21 @@ namespace std
421476
return 0;
422477
}
423478
};
479+
424480
template<>
425481
struct numeric_limits<::ranges::detail::diffmax_t const>
426482
: numeric_limits<::ranges::detail::diffmax_t>
427483
{};
484+
428485
template<>
429486
struct numeric_limits<::ranges::detail::diffmax_t volatile>
430487
: numeric_limits<::ranges::detail::diffmax_t>
431488
{};
489+
432490
template<>
433491
struct numeric_limits<::ranges::detail::diffmax_t const volatile>
434492
: numeric_limits<::ranges::detail::diffmax_t>
435493
{};
436-
437-
#if RANGES_CXX_INLINE_VARIABLES >= RANGES_CXX_INLINE_VARIABLES_17
438-
inline constexpr bool numeric_limits<::ranges::detail::diffmax_t>::is_specialized;
439-
inline constexpr bool numeric_limits<::ranges::detail::diffmax_t>::is_signed;
440-
inline constexpr bool numeric_limits<::ranges::detail::diffmax_t>::is_integer;
441-
inline constexpr bool numeric_limits<::ranges::detail::diffmax_t>::is_exact;
442-
inline constexpr bool numeric_limits<::ranges::detail::diffmax_t>::has_infinity;
443-
inline constexpr bool numeric_limits<::ranges::detail::diffmax_t>::has_quiet_NaN;
444-
inline constexpr bool numeric_limits<::ranges::detail::diffmax_t>::has_signaling_NaN;
445-
inline constexpr bool numeric_limits<::ranges::detail::diffmax_t>::has_denorm;
446-
inline constexpr bool numeric_limits<::ranges::detail::diffmax_t>::has_denorm_loss;
447-
inline constexpr std::float_round_style
448-
numeric_limits<::ranges::detail::diffmax_t>::round_style;
449-
inline constexpr bool numeric_limits<::ranges::detail::diffmax_t>::is_iec559;
450-
inline constexpr bool numeric_limits<::ranges::detail::diffmax_t>::is_bounded;
451-
inline constexpr bool numeric_limits<::ranges::detail::diffmax_t>::is_modulo;
452-
inline constexpr int numeric_limits<::ranges::detail::diffmax_t>::digits;
453-
inline constexpr int numeric_limits<::ranges::detail::diffmax_t>::digits10;
454-
inline constexpr int numeric_limits<::ranges::detail::diffmax_t>::max_digits10;
455-
inline constexpr int numeric_limits<::ranges::detail::diffmax_t>::radix;
456-
inline constexpr int numeric_limits<::ranges::detail::diffmax_t>::min_exponent;
457-
inline constexpr int numeric_limits<::ranges::detail::diffmax_t>::min_exponent10;
458-
inline constexpr int numeric_limits<::ranges::detail::diffmax_t>::max_exponent;
459-
inline constexpr int numeric_limits<::ranges::detail::diffmax_t>::max_exponent10;
460-
inline constexpr bool numeric_limits<::ranges::detail::diffmax_t>::traps;
461-
inline constexpr bool numeric_limits<::ranges::detail::diffmax_t>::tinyness_before;
462-
#endif
463494
} // namespace std
464495
/// \endcond
465496

include/range/v3/utility/static_const.hpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,23 @@
1313
#ifndef RANGES_V3_UTILITY_STATIC_CONST_HPP
1414
#define RANGES_V3_UTILITY_STATIC_CONST_HPP
1515

16+
#include <range/v3/detail/config.hpp>
17+
1618
namespace ranges
1719
{
1820
/// \ingroup group-utility
19-
2021
template<typename T>
2122
struct static_const
2223
{
23-
static constexpr T value{};
24+
static constexpr T const value{};
2425
};
2526

27+
#if RANGES_CXX_INLINE_VARIABLES < RANGES_CXX_INLINE_VARIABLES_17
2628
/// \ingroup group-utility
2729
/// \sa `static_const`
2830
template<typename T>
29-
constexpr T static_const<T>::value;
31+
constexpr T const static_const<T>::value;
32+
#endif
3033
} // namespace ranges
3134

3235
#endif

0 commit comments

Comments
 (0)