[Boost-bugs] [Boost C++ Libraries] #8489: Unnecessary Definition of ??? Has Dangerous Return of Temporary Object

Subject: [Boost-bugs] [Boost C++ Libraries] #8489: Unnecessary Definition of ??? Has Dangerous Return of Temporary Object
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-04-24 00:37:06


#8489: Unnecessary Definition of ??? Has Dangerous Return of Temporary Object
---------------------------------------------------+------------------------
 Reporter: Jeffrey D. Oldham <oldham@…> | Owner: jeffrey.hellrung
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: iterator
  Version: Boost 1.53.0 | Severity: Problem
 Keywords: |
---------------------------------------------------+------------------------
 Change definition of private iterator_adaptor<...>::dereference to a
 declaration, avoiding illegal
 return of local temporary object:
   error: returning reference to local temporary object [-Werror,-Wreturn-
 stack-address]
     { return *m_iterator; }
 Changing to a declaration is semantically acceptable because the preceding
 comment and a code search shows that the function was made private to
 ensure it is not used in this base class.

 This was revealed using Clang++ 3.0.6. It is a showstopper for people
 required to use Clang with warnings turned in errors.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8489>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:12 UTC