Skip to content

Commit 7b34e69

Browse files
committed
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.
1 parent 9396f77 commit 7b34e69

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/fmt/format-inl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,10 +1477,10 @@ template <typename T> struct span {
14771477
};
14781478

14791479
template <typename F> auto flockfile(F* f) -> decltype(_lock_file(f)) {
1480-
_lock_file(f);
1480+
return _lock_file(f);
14811481
}
14821482
template <typename F> auto funlockfile(F* f) -> decltype(_unlock_file(f)) {
1483-
_unlock_file(f);
1483+
return _unlock_file(f);
14841484
}
14851485

14861486
#ifndef getc_unlocked

0 commit comments

Comments
 (0)