You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently build with -Wdangling-reference (g++ 14.1.0) gives the following:
.../date/include/date/date.h:6594:15: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
6594 | auto& f = std::use_facet<std::time_get<CharT>>(is.getloc());
.../date/include/date/date.h:6594:55: note: the temporary was destroyed at the end of the full expression ‘std::use_facet<__cxx11::time_get<char> >(std::ios_base::getloc() const())’
#if !ONLY_C_LOCALE
- auto& f = std::use_facet<std::time_get<CharT>>(is.getloc());
+ auto loc = is.getloc();
+ auto& f = std::use_facet<std::time_get<CharT>>(loc);
std::tm tm{};
#endif
The text was updated successfully, but these errors were encountered:
Currently build with
-Wdangling-reference
(g++ 14.1.0) gives the following:See https://github.com/HowardHinnant/date/blob/master/include/date/date.h#L6594
The following patch fixes the issue for me:
The text was updated successfully, but these errors were encountered: