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

--- Comment #13 from Christopher Head <headch at gmail dot com> ---
Could the error message be made more readable by trying to call an
undefined-but-declared non-consteval function inside the consteval context in
the error case, rather than throwing? The name of the function could then be
the error message? For example:


struct __unspec
{
  static void __comparisonCategoryComparedToNonZeroValue();

  template<same_as<int> _Tp>
  consteval __unspec(_Tp __z) noexcept
  {
    if (__z != 0) __comparisonCategoryComparedToNonZeroValue();
  }
};

You then get the error “call to non-‘constexpr’ function ‘static void
__unspec::__comparisonCategoryComparedToNonZeroValue()’”

Reply via email to