From: Jakub Jelinek <jakub@redhat.com>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org
Subject: [PATCH] libstdc++: Work around clang misdesign in time_get<>::get [PR104990]
Date: Mon, 21 Mar 2022 07:42:53 +0100 [thread overview]
Message-ID: <YjgebfpclpVUaQqG@tucnak> (raw)
Hi!
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.
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
2022-03-21 Jakub Jelinek <jakub@redhat.com>
PR libstdc++/104990
* include/bits/locale_facets_nonio.tcc (get): Don't check if do_get
isn't overloaded if __clang__ is defined.
--- libstdc++-v3/include/bits/locale_facets_nonio.tcc 2022-03-18 10:37:41.176593188 +0100
+++ libstdc++-v3/include/bits/locale_facets_nonio.tcc 2022-03-20 20:28:07.203815325 +0100
@@ -1465,7 +1465,7 @@ _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11
ctype<_CharT> const& __ctype = use_facet<ctype<_CharT> >(__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
Jakub
next reply other threads:[~2022-03-21 6:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-21 6:42 Jakub Jelinek [this message]
2022-03-21 10:00 ` Jonathan Wakely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YjgebfpclpVUaQqG@tucnak \
--to=jakub@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jwakely@redhat.com \
--cc=libstdc++@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).