This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/54930] New: Add warning switch for "returning reference to temporary" and similar


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54930

             Bug #: 54930
           Summary: Add warning switch for "returning reference to
                    temporary" and similar
    Classification: Unclassified
           Product: gcc
           Version: 4.6.4
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: enhancement
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: redi@gcc.gnu.org


The various warnings issued by maybe_warn_about_returning_address_of_local()
are enabled by default, so there is no way to make them (and only them) into
errors.

If they were controlled by a switch such as -Wreturn-local-addr (enabled by
default) then they could be promoted to an error with -Werror=return-local-addr
(or disabled with -Wno-return-local-addr for the foolish.)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]