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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
As for the missing first error, the function is cp_folded into
return <retval> = i == 0 ? -2147483648(OVF) : 2147483647;
Thus, I wonder if VERIFY_CONSTANT or something similar shouldn't be done either
in cxx_eval_constant_expression's
  if (CONSTANT_CLASS_P (t))
    {
      if (TREE_OVERFLOW (t) && (!flag_permissive || ctx->quiet))
        *overflow_p = true;
      return t;
    }
or on the other side, when evaluating the whole constexpr function call (and if
there shouldn't be some way to report it only once, not many times).
I think there is some other PR that it would be nice to just remember what kind
of errors were seen during constexpr evaluation and at what locus and let the
caller emit the diagnostics.

Reply via email to