libstdc++: Add unused attributes to shared_ptr functions

This avoids some warnings when building with -fno-rtti because the
function parameters are only used when RTTI is enabled.

libstdc++-v3/ChangeLog:

	* include/bits/shared_ptr_base.h (__shared_ptr::_M_get_deleter):
	Add unused attribute to parameter.
	* src/c++11/shared_ptr.cc (_Sp_make_shared_tag::_S_eq):
	Likewise.
This commit is contained in:
Jonathan Wakely 2021-02-12 10:36:18 +00:00
parent c4ece1d96a
commit 87eaa3c525
2 changed files with 2 additions and 2 deletions

View File

@ -450,7 +450,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
virtual void*
_M_get_deleter(const std::type_info& __ti) noexcept
_M_get_deleter(const type_info& __ti [[__gnu__::__unused__]]) noexcept
{
#if __cpp_rtti
// _GLIBCXX_RESOLVE_LIB_DEFECTS

View File

@ -97,7 +97,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#endif
bool
_Sp_make_shared_tag::_S_eq(const type_info& ti) noexcept
_Sp_make_shared_tag::_S_eq(const type_info& ti [[gnu::unused]]) noexcept
{
#if __cpp_rtti
return ti == typeid(_Sp_make_shared_tag);