Ran across this while using the Boost graph package. Test program: ---------------------- #include <boost/graph/graph_traits.hpp> #include <boost/graph/adjacency_list.hpp> namespace boost { enum vertex_subgraph_t { vertex_subgraph }; BOOST_INSTALL_PROPERTY(vertex, subgraph); enum vertex_order_t { vertex_order }; BOOST_INSTALL_PROPERTY(vertex, order); enum edge_back_t { edge_back }; BOOST_INSTALL_PROPERTY(edge, back); }; typedef boost::property<boost::vertex_distance_t, int, boost::property<boost::vertex_name_t, std::string, boost::property<boost::vertex_subgraph_t, int, boost::property<boost::vertex_order_t, int > > > > VertexProperty; typedef boost::property<boost::edge_back_t, bool > EdgeProperties; typedef boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, VertexProperty, EdgeProperties > FlowLayoutGraph; typedef boost::graph_traits< FlowLayoutGraph >::vertex_descriptor vertex_descriptor; void break_gcc(FlowLayoutGraph& m_graph, vertex_descriptor v1, vertex_descriptor v2) { add_edge(v1, v2, m_graph); } -------------------------------- Obtain and unpack Boost 1.33.1. Compile the above with a command like: g++ -c -I/path/to/boost_1_33_1 -O -Wuninitialized filename.cpp You should see a message complaining that `p$m_value' is used uninitialized. (This is, as you probably already realize, a name generated internally by g++; there is no such variable in the source.)
I tried 4.1.2 RC1 -- the bug is still present.
>(This is, as you probably already realize, a name generated internally by g++; > there is no such variable in the source.) The name is generated internally by g++ but it is really p.m_value which was actually already fixed in 4.1.2 (PR 14329) as I fixed it :). Can you paste the warning message that 4.1.2RC1 gives? Can you attach the preprocessed source?
Actually, I didn't look closely enough; the error generated by 4.1.2 RC1 is different: /usr/local/gcc-4.1.2/lib/gcc/i386-pc-solaris2.11/4.1.2/../../../../include/c++/4.1.2/ext/new_allocator.h: In function void break_gcc(FlowLayoutGraph&, vertex_descriptor, vertex_descriptor): /usr/local/gcc-4.1.2/lib/gcc/i386-pc-solaris2.11/4.1.2/../../../../include/c++/4.1.2/ext/new_allocator.h:104: warning: p.boost::property<boost::edge_back_t, bool, boost::no_property>::m_value is used uninitialized in this function
Created attachment 13010 [details] Preprocessed source, as requested (gzipped)
This is a true warning. With the mainline we get an extra note: boost_1_33_1/boost/graph/detail/adjacency_list.hpp:2116: note: 'p.boost::property<boost::edge_back_t, bool, boost::no_property>::m_value' was declared here That was added for fixing PR 17506. which shows that this is a bug in boost's headers.
Ah, very good. Thanks for taking a look at this.