public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org
Subject: Re: [PATCH] libstdc++: Fix up <complex> for extended floating point types [PR107649]
Date: Wed, 16 Nov 2022 13:45:19 +0000	[thread overview]
Message-ID: <CACb0b4=ji55nx-0HDM-Xs6wYVVa_thQGS8AFF6sZKR-u6biE=Q@mail.gmail.com> (raw)
In-Reply-To: <CACb0b4n1pgUm2qLBeaF=j0bxQgpkx73iz5FTqJ5Qdv5mGFkt7A@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1475 bytes --]

On Wed, 16 Nov 2022 at 13:42, Jonathan Wakely <jwakely@redhat.com> wrote:

>
>
> On Mon, 14 Nov 2022 at 13:57, Jakub Jelinek <jakub@redhat.com> wrote:
>
>> Hi!
>>
>> As filed by Jonathan in the PR, I've screwed up the requires syntax
>> in the extended floating point specialization:
>> -    requires(__complex_type<_Tp>::type)
>> +    requires requires { typename __complex_type<_Tp>::type; }
>> and doing this change resulted in lots of errors because
>> __complex_whatever
>> overfloads from extended floating point types were declared after the
>> templates which used them.
>>
>> The following patch fixes that.
>>
>> Bootstrapped/regtested on x86_64-linux and i686-linux, additionally
>> I've tested that with _GLIBCXX_HAVE_FLOAT128_MATH not being defined
>> while __STDCPP_FLOAT128_T__ defined one can still use
>> std::complex<std::float128_t> for basic arithmetic etc., just one can't
>> expect std::sin etc. to work in that case (because we don't have any
>> implementation).
>>
>> Ok for trunk?
>>
>
> OK, thanks for the quick fix.
>

Oh, also no released version of Clang can handle the C++20 rules about
'typename' yet, so we get this error:

complex:1843:15: error: no template named 'type' in '__complex_ty
pe<_Tp>'; did you mean 'ctype'?
     typedef std::__complex_type<_Tp>::type _ComplexT;
             ^~~~~~~~~~~~~~~~~~~~~~~~~~
It needs a 'typename' after 'typedef'.

I can add that if you want though.

(It's fixed on Clang trunk, so will be in 16.0.0)

  reply	other threads:[~2022-11-16 13:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-14 13:57 Jakub Jelinek
2022-11-16 13:42 ` Jonathan Wakely
2022-11-16 13:45   ` Jonathan Wakely [this message]
2022-11-16 13:47     ` Jakub Jelinek
2022-11-16 13:48       ` 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='CACb0b4=ji55nx-0HDM-Xs6wYVVa_thQGS8AFF6sZKR-u6biE=Q@mail.gmail.com' \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@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).