Support printing (const) volatile void* (#4056)

Fixes #4049
This commit is contained in:
Justin Riddell
2024-07-10 16:35:06 +01:00
committed by GitHub
parent 6725225750
commit 13038f37e8
2 changed files with 14 additions and 0 deletions

View File

@@ -425,6 +425,14 @@ TEST(arg_test, pointer_arg) {
CHECK_ARG_SIMPLE(cp);
}
TEST(arg_test, volatile_pointer_arg) {
const void* p = nullptr;
volatile int* vip = nullptr;
const volatile int* cvip = nullptr;
CHECK_ARG(char, p, static_cast<volatile void*>(vip));
CHECK_ARG(char, p, static_cast<const volatile void*>(cvip));
}
struct check_custom {
auto operator()(fmt::basic_format_arg<fmt::format_context>::handle h) const
-> test_result {