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

            Bug ID: 121708
           Summary: make_temp_override should most likely marked as
                    nodiscard
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: internal-improvement
          Severity: enhancement
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

I noticed make_temp_override/temp_override  in cp-tree.h are not marked as
nodiscard.

This is just an minor improvement for inside the C++ front-end sources so that
it will be caught that make_temp_override was not assigned to variable it will
restore the value when the temporary lifetime ends which is most likely not an
expected behavior.

Reply via email to