[Bug c++/54930] New: Add warning switch for "returning reference to temporary" and similar
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Oct 15 07:49:00 GMT 2012
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.)
More information about the Gcc-bugs
mailing list