[Bug c++/92049] bogus errors with -fchecking=2

mpolacek at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Oct 10 13:22:00 GMT 2019


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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |msebor at gcc dot gnu.org

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
-fchecking=2 enables the call to fold_non_dependent_expr in
build_non_dependent_expr:

  /* 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 processing either and for
         the same reason.  */
      && !processing_constraint_expression_p ())
    fold_non_dependent_expr (expr);


More information about the Gcc-bugs mailing list