* @throw std::runtime_error if __other has no facet of type _Facet.
*/
template<typename _Facet>
+ _GLIBCXX_NODISCARD
locale
combine(const locale& __other) const;
* @brief Return locale name.
* @return Locale name or "*" if unnamed.
*/
- _GLIBCXX_DEFAULT_ABI_TAG
+ _GLIBCXX_NODISCARD _GLIBCXX_DEFAULT_ABI_TAG
string
name() const;
* @return True if other and this refer to the same locale instance, are
* copies, or have the same name. False otherwise.
*/
+ _GLIBCXX_NODISCARD
bool
operator==(const locale& __other) const throw();
* @param __other The locale to compare against.
* @return ! (*this == __other)
*/
+ _GLIBCXX_NODISCARD
bool
operator!=(const locale& __other) const throw()
{ return !(this->operator==(__other)); }
* @return True if collate<_Char> facet compares __s1 < __s2, else false.
*/
template<typename _Char, typename _Traits, typename _Alloc>
+ _GLIBCXX_NODISCARD
bool
operator()(const basic_string<_Char, _Traits, _Alloc>& __s1,
const basic_string<_Char, _Traits, _Alloc>& __s2) const;
/**
* @brief Return reference to the C locale.
*/
+ _GLIBCXX_NODISCARD
static const locale&
classic();
* @return true if @p __loc contains a facet of type _Facet, else false.
*/
template<typename _Facet>
+ _GLIBCXX_NODISCARD
inline bool
has_facet(const locale& __loc) _GLIBCXX_USE_NOEXCEPT
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdangling-reference"
template<typename _Facet>
+ _GLIBCXX_NODISCARD
inline const _Facet&
use_facet(const locale& __loc)
{
locale loc2 = locale("");
VERIFY( !has_facet<MyFacet>(loc2) );
- loc1.combine<MyFacet>(loc2);
+ loc1.combine<MyFacet>(loc2); // { dg-warning "nodiscard" "" { target c++17 } }
VERIFY( false );
}
catch (std::runtime_error&)