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 via email to