public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin Liška" <mliska@suse.cz>
To: Pedro Alves <pedro@palves.net>,
	Richard Biener <richard.guenther@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Remove conditional STATIC_ASSERT.
Date: Thu, 5 May 2022 14:56:09 +0200	[thread overview]
Message-ID: <f8194fe3-fcba-1975-85b0-eb9bdcf06b4a@suse.cz> (raw)
In-Reply-To: <8cc0a6a6-b10f-60f2-b7d2-5a68226ed834@palves.net>

On 5/5/22 14:51, Pedro Alves wrote:
> On 2022-05-05 13:41, Martin Liška wrote:
>> On 5/5/22 14:29, Richard Biener wrote:
>>> Can we then use static_assert (...) instead and remove the
>>> macro?
>>
>> Oh yes, we can ;)
>>
>>> Do we have C compiled code left (I think we might,
>>> otherwise we'd not have __cplusplus guards in system.h),
>>> in which case the #if should change to #ifdef __cplusplus?
>>
>> No, there's no such a consumer of the macro.
>>
>> What about the updated version of the patch?
> 
> static_assert without the second/message parameter requires C++17:
> 
>   https://en.cppreference.com/w/cpp/language/static_assert

Oh, you are correct :) Thanks:

/home/marxin/Programming/gcc/gcc/wide-int.h: In static member function ‘static wide_int wi::int_traits<wide_int_storage>::get_binary_result(const T1&, const T2&)’:
/home/marxin/Programming/gcc/gcc/wide-int.h:1205:60: warning: ‘static_assert’ without a message only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wpedantic]
 1205 |                  || wi::int_traits <T2>::precision_type != FLEXIBLE_PRECISION);

> 
> The macro expanded to always have a message argument.


That said, we should go with the original version of the patch.

Cheers,
Martin

  reply	other threads:[~2022-05-05 12:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-05 12:18 Martin Liška
2022-05-05 12:29 ` Richard Biener
2022-05-05 12:41   ` Martin Liška
2022-05-05 12:51     ` Pedro Alves
2022-05-05 12:56       ` Martin Liška [this message]
2022-05-05 13:08     ` Richard Biener
2022-05-09  8:45       ` Martin Liška
2022-05-09 12:05         ` Richard Biener

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=f8194fe3-fcba-1975-85b0-eb9bdcf06b4a@suse.cz \
    --to=mliska@suse.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=pedro@palves.net \
    --cc=richard.guenther@gmail.com \
    /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).