[Boost-bugs] [Boost C++ Libraries] #6858: boost::get() calls wrongly resolved by g++

Subject: [Boost-bugs] [Boost C++ Libraries] #6858: boost::get() calls wrongly resolved by g++
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-05-03 15:29:41


#6858: boost::get() calls wrongly resolved by g++
-----------------------------------------------------+----------------------
 Reporter: Roland Levillain <roland@…> | Owner: ebf
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: variant
  Version: Boost 1.49.0 | Severity: Problem
 Keywords: |
-----------------------------------------------------+----------------------
 Boost 1.49.0 seems to make g++ wrongly resolve some calls to
 `boost::get()`.

 The attached C++ code `boost-get-test-ko.cc` does not compile properly
 with all the g++ compiler I used (Apple g++ 4.2, [http://www.macports.org
 MacPorts] g++ 4.4, 4.5, 4.6, 4.7) on my machine (2010 !MacBook Pro w/ Mac
 OS X version 10.6.8 and Boost 1.49.0 from the !MacPorts). These compilers
 try to use `boost::get()` from `boost/graph/reverse_graph.hpp` instead of
 `boost::get()` from `boost/variant/get.hpp`, leading to this kind of error
 messages:

 {{{
 % g++-mp-4.7 -I/opt/local/include boost-get-test-ko.cc
 In file included from
 /opt/local/include/boost/graph/vector_as_graph.hpp:23:0,
                  from
 /opt/local/include/boost/graph/transitive_closure.hpp:17,
                  from boost-get-test-ko.cc:2:
 /opt/local/include/boost/graph/graph_traits.hpp: In instantiation of
 'struct boost::graph_traits<int>':
 /opt/local/include/boost/graph/reverse_graph.hpp:472:1: required by
 substitution of 'template<class Graph, class GRef> typename
 boost::graph_traits<Graph>::edge_descriptor
 boost::get(boost::edge_underlying_t, const
 boost::reverse_graph<BidirectionalGraph, GraphRef>&, const typename
 boost::graph_traits<boost::reverse_graph<BidirectionalGraph, GraphRef>
>::edge_descriptor&) [with Graph = int; GRef = <missing>]'
 boost-get-test-ko.cc:7:28: required from here
 /opt/local/include/boost/graph/graph_traits.hpp:30:52: error: 'int' is not
 a class, struct, or union type
 /opt/local/include/boost/graph/graph_traits.hpp:31:52: error: 'int' is not
 a class, struct, or union type
 /opt/local/include/boost/graph/graph_traits.hpp:32:52: error: 'int' is not
 a class, struct, or union type
 /opt/local/include/boost/graph/graph_traits.hpp:33:52: error: 'int' is not
 a class, struct, or union type
 /opt/local/include/boost/graph/graph_traits.hpp:34:52: error: 'int' is not
 a class, struct, or union type
 /opt/local/include/boost/graph/graph_traits.hpp:35:52: error: 'int' is not
 a class, struct, or union type
 /opt/local/include/boost/graph/graph_traits.hpp:36:52: error: 'int' is not
 a class, struct, or union type
 /opt/local/include/boost/graph/graph_traits.hpp:38:52: error: 'int' is not
 a class, struct, or union type
 /opt/local/include/boost/graph/graph_traits.hpp:39:52: error: 'int' is not
 a class, struct, or union type
 /opt/local/include/boost/graph/graph_traits.hpp:40:52: error: 'int' is not
 a class, struct, or union type
 /opt/local/include/boost/graph/graph_traits.hpp:42:52: error: 'int' is not
 a class, struct, or union type
 /opt/local/include/boost/graph/graph_traits.hpp:43:52: error: 'int' is not
 a class, struct, or union type
 /opt/local/include/boost/graph/graph_traits.hpp:44:52: error: 'int' is not
 a class, struct, or union type
 }}}

 If the `#include <boost/graph/transitive_closure.hpp>` statement is
 removed (see attached file `boost-get-test-ok.cc`, no compiling error
 arises.

 This problem looks very similar to ticket #4838.

 I have obtained similar results with SVN Boost on this platform as well as
 on Debian GNU/Linux 6.0.4 on x86-64 with g++ 4.4.

 The versions of clang++ I tried (!MacPorts clang++ 2.9, 3.0 and 3.1 on Mac
 OS X version 10.6 and clang 3.0 on Debian GNU/Linux 6.0.4) have no trouble
 compiling both files.

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