File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -1121,7 +1121,7 @@ using use_formatter =
1121
1121
bool_constant<(std::is_class<T>::value || std::is_enum<T>::value ||
1122
1122
std::is_union<T>::value || std::is_array<T>::value) &&
1123
1123
!has_to_string_view<T>::value && !is_named_arg<T>::value &&
1124
- !use_format_as<T>::value && !use_format_as_member<T >::value>;
1124
+ !use_format_as<T>::value && !use_format_as_member<U >::value>;
1125
1125
1126
1126
template <typename Char, typename T, typename U = remove_const_t <T>>
1127
1127
auto has_formatter_impl (T* p, buffered_context<Char>* ctx = nullptr )
Original file line number Diff line number Diff line change 13
13
#include < vector>
14
14
15
15
#include " fmt/os.h" // fmt::system_category
16
- #include " fmt/ranges.h"
17
16
#include " gtest-extra.h" // StartsWith
18
17
19
18
#ifdef __cpp_lib_filesystem
20
19
TEST (std_test, path) {
21
20
using std::filesystem::path;
22
21
EXPECT_EQ (fmt::format (" {}" , path (" /usr/bin" )), " /usr/bin" );
22
+
23
+ // see #4303
24
+ const path p = " /usr/bin" ;
25
+ EXPECT_EQ (fmt::format (" {}" , p), " /usr/bin" );
26
+
23
27
EXPECT_EQ (fmt::format (" {:?}" , path (" /usr/bin" )), " \" /usr/bin\" " );
24
28
EXPECT_EQ (fmt::format (" {:8}" , path (" foo" )), " foo " );
25
29
@@ -44,6 +48,9 @@ TEST(std_test, path) {
44
48
# endif
45
49
}
46
50
51
+ // Intentionally delayed include to test #4303
52
+ #include " fmt/ranges.h"
53
+
47
54
// Test ambiguity problem described in #2954.
48
55
TEST (ranges_std_test, format_vector_path) {
49
56
auto p = std::filesystem::path (" foo/bar.txt" );
You can’t perform that action at this time.
0 commit comments