Re: [PATCH] c++: Fix noexcept with unevaluated operand [PR101087]

2021-07-08 Thread Marek Polacek via Gcc-patches
On Thu, Jul 08, 2021 at 09:30:27AM -0400, Jason Merrill wrote: > On 7/7/21 9:40 PM, Marek Polacek wrote: > > It sounds plausible that this assert > > > >int f(); > >static_assert(noexcept(sizeof(f(; > > > > should pass: sizeof produces a std::size_t and its operand is not > > evaluate

Re: [PATCH] c++: Fix noexcept with unevaluated operand [PR101087]

2021-07-08 Thread Jason Merrill via Gcc-patches
On 7/7/21 9:40 PM, Marek Polacek wrote: It sounds plausible that this assert int f(); static_assert(noexcept(sizeof(f(; should pass: sizeof produces a std::size_t and its operand is not evaluated, so it can't throw. noexcept should only evaluate to false for potentially evaluated ope

[PATCH] c++: Fix noexcept with unevaluated operand [PR101087]

2021-07-07 Thread Marek Polacek via Gcc-patches
It sounds plausible that this assert int f(); static_assert(noexcept(sizeof(f(; should pass: sizeof produces a std::size_t and its operand is not evaluated, so it can't throw. noexcept should only evaluate to false for potentially evaluated operands. Therefore I think that check_noexcep