Skip to content

Commit

Permalink
Use void(*)(void*) instead of decltype(&std::free) to satisfy clang i…
Browse files Browse the repository at this point in the history
…n CUDA mode (fmtlib#3751)

clang can't resolve &std::free in decltype(&std::free) because std::free
is overloaded (for host and device).
  • Loading branch information
msimberg authored and happymonkey1 committed Apr 6, 2024
1 parent 42d1650 commit fe949e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/fmt/std.h
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ struct formatter<
# ifdef FMT_HAS_ABI_CXA_DEMANGLE
int status = 0;
std::size_t size = 0;
std::unique_ptr<char, decltype(&std::free)> demangled_name_ptr(
std::unique_ptr<char, void(*)(void*)> demangled_name_ptr(
abi::__cxa_demangle(ti.name(), nullptr, &size, &status), &std::free);

string_view demangled_name_view;
Expand Down

0 comments on commit fe949e7

Please sign in to comment.