From: Jakub Jelinek Date: Mon, 21 Mar 2022 10:02:04 +0000 (+0100) Subject: libstdc++: Work around clang misdesign in time_get<>::get [PR104990] X-Git-Tag: upstream/12.2.0~963 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e63ac860afe816fef6b86bee6e47980e1351213c;p=platform%2Fupstream%2Fgcc.git libstdc++: Work around clang misdesign in time_get<>::get [PR104990] Apparently clang has a -fgnuc-version= option which allows it to pretend it is any GCC version the user likes. It is already bad that it claims to be GCC 4.2 compatible by default when it is not (various unimplemented extensions at least), but this option is a horrible idea. Anyway, this patch adds a hack for it. 2022-03-21 Jakub Jelinek PR libstdc++/104990 * include/bits/locale_facets_nonio.tcc (get): Don't check if do_get isn't overloaded if __clang__ is defined. --- diff --git a/libstdc++-v3/include/bits/locale_facets_nonio.tcc b/libstdc++-v3/include/bits/locale_facets_nonio.tcc index 8c37a70..17a2c8d 100644 --- a/libstdc++-v3/include/bits/locale_facets_nonio.tcc +++ b/libstdc++-v3/include/bits/locale_facets_nonio.tcc @@ -1465,7 +1465,7 @@ _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11 ctype<_CharT> const& __ctype = use_facet >(__loc); __err = ios_base::goodbit; bool __use_state = false; -#if __GNUC__ >= 5 +#if __GNUC__ >= 5 && !defined(__clang__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpmf-conversions" // Nasty hack. The C++ standard mandates that get invokes the do_get