From 7b34e69f4bddfe924fa7da318210a4570c185d4e Mon Sep 17 00:00:00 2001 From: Mike Vastola Date: Thu, 9 Apr 2026 19:24:25 -0400 Subject: [PATCH] Fix bug re: return type of `f(un)lockfile` wrappers for Windows Just a tiny bugfix I spotted: The `f(un)lockfile` wrappers in `format-inl.h` that wrap Windows's `_(un)lock_file` methods are defined with a trailing return type derived by using decltype on a hypothetical call to the underlying functions. The wrappers don't contain a `return` in their bodies, however, so if the return type of the underlying functions were to ever change from `void`, there would be a compile error. This just adds `return` to each. --- include/fmt/format-inl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index cc110198..539b1fd7 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -1477,10 +1477,10 @@ template struct span { }; template auto flockfile(F* f) -> decltype(_lock_file(f)) { - _lock_file(f); + return _lock_file(f); } template auto funlockfile(F* f) -> decltype(_unlock_file(f)) { - _unlock_file(f); + return _unlock_file(f); } #ifndef getc_unlocked