https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123889

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This case still doesn't explain the problem on trunk:

#pragma GCC diagnostic ignored "-Wc++17-extensions"

template<typename U>
constexpr bool
big(U)
{
  if constexpr (sizeof(U) > 4)
    return true;
  else
    return false;
}

static_assert( big(1) );


$ g++ -std=c++11 ce.cc -c
ce.cc:13:19: error: non-constant condition for static assertion
   13 | static_assert( big(1) );
      |                ~~~^~~
ce.cc:13:19: error: 'constexpr bool big(U) [with U = int]' called in a constant
expression
ce.cc:5:5: note: 'constexpr bool big(U) [with U = int]' is not usable as a
'constexpr' function because:
    5 |     big(U)
      |     ^~~

Reply via email to