Page MenuHomeFreeBSD

bsd.sys.mk: Disable -Wdangling-reference for GCC 13+
ClosedPublic

Authored by jhb on Nov 13 2023, 10:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 1, 6:03 AM
Unknown Object (File)
Fri, Nov 1, 2:57 AM
Unknown Object (File)
Oct 1 2024, 2:10 PM
Unknown Object (File)
Sep 17 2024, 2:25 PM
Unknown Object (File)
Sep 8 2024, 5:44 PM
Unknown Object (File)
Sep 7 2024, 10:26 AM
Unknown Object (File)
Sep 5 2024, 12:49 AM
Unknown Object (File)
Sep 3 2024, 5:42 AM
Subscribers

Details

Summary

GCC raises this warning for libc++'s istream. It raises false
positives in other cases as well (GCC bugs 109640, 109642, 109671).

Warning from <istream>:

/usr/include/c++/v1/istream:1464:34: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
1464 | const ctype<_CharT>& ct = std::use_facet<ctype<_CharT> >(is.getloc());

|                                  ^~~~

/usr/include/c++/v1/istream:1464:71: note: the temporary was destroyed at the end of the full expression 'std::1::use_facet<ctype<char> >(std::1::ios_base::getloc() const())'
1464 | const ctype<_CharT>& ct = std::use_facet<ctype<_CharT> >(is.getloc());

|                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable