mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-30 02:37:36 +02:00
Fix diagnostics
This commit is contained in:
@ -516,7 +516,6 @@ struct compile_string {};
|
|||||||
template <typename S>
|
template <typename S>
|
||||||
struct is_compile_string : std::is_base_of<compile_string, S> {};
|
struct is_compile_string : std::is_base_of<compile_string, S> {};
|
||||||
|
|
||||||
// Returns a string view of `s`.
|
|
||||||
template <typename Char, FMT_ENABLE_IF(is_char<Char>::value)>
|
template <typename Char, FMT_ENABLE_IF(is_char<Char>::value)>
|
||||||
FMT_INLINE auto to_string_view(const Char* s) -> basic_string_view<Char> {
|
FMT_INLINE auto to_string_view(const Char* s) -> basic_string_view<Char> {
|
||||||
return s;
|
return s;
|
||||||
@ -1209,7 +1208,6 @@ constexpr auto count_statically_named_args() -> size_t {
|
|||||||
|
|
||||||
struct unformattable {};
|
struct unformattable {};
|
||||||
struct unformattable_char : unformattable {};
|
struct unformattable_char : unformattable {};
|
||||||
struct unformattable_const : unformattable {};
|
|
||||||
struct unformattable_pointer : unformattable {};
|
struct unformattable_pointer : unformattable {};
|
||||||
|
|
||||||
template <typename Char> struct string_value {
|
template <typename Char> struct string_value {
|
||||||
@ -1287,7 +1285,6 @@ template <typename Context> class value {
|
|||||||
}
|
}
|
||||||
value(unformattable);
|
value(unformattable);
|
||||||
value(unformattable_char);
|
value(unformattable_char);
|
||||||
value(unformattable_const);
|
|
||||||
value(unformattable_pointer);
|
value(unformattable_pointer);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -1449,7 +1446,7 @@ template <typename Context> struct arg_mapper {
|
|||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
template <typename T, FMT_ENABLE_IF(!formattable<T>::value)>
|
template <typename T, FMT_ENABLE_IF(!formattable<T>::value)>
|
||||||
FMT_CONSTEXPR FMT_INLINE auto do_map(T&&) -> unformattable_const {
|
FMT_CONSTEXPR FMT_INLINE auto do_map(T&&) -> unformattable {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1680,10 +1677,6 @@ FMT_CONSTEXPR FMT_INLINE auto make_value(T&& val) -> value<Context> {
|
|||||||
!std::is_same<decltype(arg), const unformattable_char&>::value;
|
!std::is_same<decltype(arg), const unformattable_char&>::value;
|
||||||
static_assert(formattable_char, "Mixing character types is disallowed.");
|
static_assert(formattable_char, "Mixing character types is disallowed.");
|
||||||
|
|
||||||
constexpr bool formattable_const =
|
|
||||||
!std::is_same<decltype(arg), const unformattable_const&>::value;
|
|
||||||
static_assert(formattable_const, "Cannot format a const argument.");
|
|
||||||
|
|
||||||
// Formatting of arbitrary pointers is disallowed. If you want to format a
|
// Formatting of arbitrary pointers is disallowed. If you want to format a
|
||||||
// pointer cast it to `void*` or `const void*`. In particular, this forbids
|
// pointer cast it to `void*` or `const void*`. In particular, this forbids
|
||||||
// formatting of `[const] volatile char*` printed as bool by iostreams.
|
// formatting of `[const] volatile char*` printed as bool by iostreams.
|
||||||
|
Reference in New Issue
Block a user