fmt/test
Kefu Chai 274ba2645b
allow format_as() to format reference (#3739)
before this change, format_as() is unable to format a type which
has `auto format_as() -> const another_type&`, and `another_type`
is formattable. because `format_as_result` maps the result type
as it is, and the compiler refuses to compile
`static_cast<T*>(nullptr)`, where T is a reference type. but
it would be handy if we could use `format_as()` to format types
which, for instance, owns / inherit from a formattable type, and
delegate the formatter to these variables instead without creating
a copy of them.

in this change:

* instruct `format_as_result` to map the
  result type to the decayed type, so that `type` can be the decayed
  type of result type, and this also enables `type` to be formattable,
  as long as the decayed type is formattable.
* corresponding test is added to format-test.cc

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2023-12-10 08:49:53 -08:00
..
add-subdirectory-test Bump tested CMake version to 3.25 2022-11-30 08:09:32 -08:00
compile-error-test Bump tested CMake version to 3.25 2022-11-30 08:09:32 -08:00
cuda-test Making CUDA test work with CMAKE_MSVC_RUNTIME_LIBRARY 2019-09-25 06:46:11 -07:00
find-package-test Bump tested CMake version to 3.25 2022-11-30 08:09:32 -08:00
fuzzing Use target_compile_features to specify C++ standard requirement 2022-11-26 11:03:17 -08:00
gtest Fix typo in gmock-gtest-all.cc (#3747) 2023-12-09 08:13:20 -08:00
static-export-test Bump tested CMake version to 3.25 2022-11-30 08:09:32 -08:00
args-test.cc Fix error C2668 on msvc (#3378) 2023-04-11 06:27:28 -07:00
assert-test.cc gtest: move GTest/GMock files to separate directory, update GTest/GMock usages 2021-04-29 07:11:49 -07:00
chrono-test.cc Report out-of-range errors in chrono 2023-12-10 08:28:50 -08:00
CMakeLists.txt Avoid a space in the UDL definition (#3610) 2023-09-18 08:09:42 -07:00
color-test.cc Implement styled arguments (#2793) 2022-03-08 09:50:14 -08:00
compile-fp-test.cc Simplify ceil 2023-05-24 11:51:34 -07:00
compile-test.cc Fix formatted_size with FMT_COMPILE and format specs (#3588) 2023-08-15 06:45:48 -07:00
core-test.cc Call parse on empty specs at compile time 2023-07-15 22:20:29 -07:00
detect-stdfs.cc Fix std::variant, std::filesystem::path tests on GCC-8, Clang-7,8. 2022-07-02 08:34:52 -07:00
enforce-checks-test.cc Workaround C complex.h idiocy 2022-09-03 06:35:55 -07:00
format-impl-test.cc Fix a libc++ warning and move the test to the right place 2023-11-25 08:20:53 -08:00
format-test.cc allow format_as() to format reference (#3739) 2023-12-10 08:49:53 -08:00
gtest-extra-test.cc Make gtest-extra-test more portable 2023-11-24 10:09:21 -08:00
gtest-extra.cc Make gtest-extra-test more portable 2023-11-24 10:09:21 -08:00
gtest-extra.h Make gtest-extra-test more portable 2023-11-24 10:09:21 -08:00
header-only-test.cc Disable fallback_formatter for arrays 2021-09-03 08:59:36 -07:00
mock-allocator.h Update tests to use recommended MOCK_METHOD (#3395) 2023-04-20 13:16:21 -07:00
module-test.cc Improve module testing (#3397) 2023-05-03 07:56:24 -07:00
noexception-test.cc Improve noexception test 2021-12-26 16:28:41 -08:00
os-test.cc unicode_to_utf8 -> to_utf8 since both sides of conversion are Unicode 2023-05-10 16:26:02 -07:00
ostream-test.cc Fix the default locale in ostream_formatter 2023-11-24 09:24:43 -08:00
posix-mock-test.cc change sopen_s to wsopen_s (fmtlib#3234) (#3293) 2023-02-16 11:17:55 -08:00
posix-mock.h change sopen_s to wsopen_s (fmtlib#3234) (#3293) 2023-02-16 11:17:55 -08:00
printf-test.cc Detemplatize printf more 2023-05-17 12:34:12 -07:00
ranges-odr-test.cc Reformat all source code; no functional changes 2021-11-25 09:15:25 -08:00
ranges-test.cc Fix an inconsistentcy between to_string and format 2023-10-28 08:05:11 -07:00
scan-test.cc Experiment with scan buffering 2023-12-03 08:09:36 -08:00
scan.h Experiment with scan buffering 2023-12-03 08:09:36 -08:00
std-test.cc Simplify test 2023-12-01 08:52:42 -08:00
test-assert.h Move is_char specializations to xchar.h 2021-06-06 15:32:30 -07:00
test-main.cc Fixed all clang -Wreserved-id-macro warnings (on macOS at least) 2022-03-24 07:33:43 -07:00
unicode-test.cc Fix locale name (thanks Mikhail Paulyshka) 2022-08-20 08:06:20 -07:00
util.cc Disable locale-specific tests on OpenBSD 2023-11-24 09:45:56 -08:00
util.h Improve module testing (#3397) 2023-05-03 07:56:24 -07:00
xchar-test.cc Fix a libc++ warning and move the test to the right place 2023-11-25 08:20:53 -08:00