From be98ea8addfd8f0dd6f319e7818f94988728ca0a Mon Sep 17 00:00:00 2001 From: Mike Vastola Date: Fri, 10 Apr 2026 11:01:13 -0400 Subject: [PATCH] Fix bug re: return type of `f(un)lockfile` wrappers for Windows (#4739) 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