[Boost-bugs] [Boost C++ Libraries] #6167: Assignment from a temporary of a class containing boost::unordered_map members fails with GNU GCC.

Subject: [Boost-bugs] [Boost C++ Libraries] #6167: Assignment from a temporary of a class containing boost::unordered_map members fails with GNU GCC.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-11-23 10:49:37


#6167: Assignment from a temporary of a class containing boost::unordered_map
members fails with GNU GCC.
---------------------------------------------+------------------------------
 Reporter: Geurt Vos <geurt.vos@…> | Owner: danieljames
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: unordered
  Version: Boost 1.48.0 | Severity: Problem
 Keywords: |
---------------------------------------------+------------------------------
 With boost 1.48.0 the following code does not compile anymore:

 ----

 #include <boost/unordered_map.hpp>

 struct A {
     boost::unordered_map<int, int> m;
 };

 void Test()
 {
     A a;[[BR]]
     a = A();
 }

 ----

 GCC 4.6.1 & GCC 4.1.2 say:
   11:8: error: no match for ‘operator=’ in ‘a = A()’[[BR]]
   11:8: note: candidate is:[[BR]]
   4:8: note: A& A::operator=(A&)[[BR]]
   4:8: note: no known conversion for argument 1 from ‘A’ to ‘A&’[[BR]]

 When GCC 4.6.1 is set as C++11 compiler (-std=c++0x), it compiles without
 errors.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6167>
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:07 UTC