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

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
The reason for this is:
  /* When checking, try to get a constant value for all non-dependent
     expressions in order to expose bugs in *_dependent_expression_p
     and constexpr.  This can affect code generation, see PR70704, so
     only do this for -fchecking=2.  */
  if (flag_checking > 1
      && cxx_dialect >= cxx11
      /* Don't do this during nsdmi parsing as it can lead to
         unexpected recursive instantiations.  */
      && !parsing_nsdmi ()
      /* Don't do this during concept expansion either and for
         the same reason.  */
      && !expanding_concept ())
    fold_non_dependent_expr (expr, tf_none);

but I think this is invalid ([class.derived]) NDR, so not sure if we need to
change anything.

Reply via email to