[graph] transitive_closure_test failures on gcc-4.1.x and later

Hello, I just wanted to ask whether the authors of the graph library are aware of these test failures. (See e.g. http://tinyurl.com/3dy79o) The compiler fails to find a suitable constructor for vertices. Regards, Markus

On Nov 12, 2007 7:21 AM, Markus Schöpflin <markus.schoepflin@comsoft.de> wrote:
Hello,
I just wanted to ask whether the authors of the graph library are aware of these test failures. (See e.g. http://tinyurl.com/3dy79o)
The compiler fails to find a suitable constructor for vertices.
Regards, Markus
I've just been looking at this test - I can't figure out why it would fail to compile. The actual test code (transitive_closure_test.cpp) starts off by including two files: depth_first_search.hpp and then vector_as_graph.hpp. The errors are complaining that depth_first_search can't find the function "vertices" specialized for a vector of vectors, but that function is supplied in vector_as_graph.hpp. If you switch the order of these two includes (or just leave off the depth_first_search include, since it's redundant - transitive_closure includes topological_sort, which includes depth_first_search), everything compiles and runs fine on gcc 4.1 and above. Both depth_first_search and the vertices function are templated, and not instantiated until transitive_closure is called, so I'm at a loss to explain why the order of these two includes is causing gcc to get confused. Does anyone object if I commit this fix (removing the depth_first_search include) to clear up these test failures? Regards, Aaron

Aaron Windsor wrote:
On Nov 12, 2007 7:21 AM, Markus Schöpflin <markus.schoepflin@comsoft.de> wrote:
Hello,
I just wanted to ask whether the authors of the graph library are aware of these test failures. (See e.g. http://tinyurl.com/3dy79o)
The compiler fails to find a suitable constructor for vertices.
Regards, Markus
I've just been looking at this test - I can't figure out why it would fail to compile. The actual test code (transitive_closure_test.cpp) starts off by including two files: depth_first_search.hpp and then vector_as_graph.hpp. The errors are complaining that depth_first_search can't find the function "vertices" specialized for a vector of vectors, but that function is supplied in vector_as_graph.hpp. If you switch the order of these two includes (or just leave off the depth_first_search include, since it's redundant - transitive_closure includes topological_sort, which includes depth_first_search), everything compiles and runs fine on gcc 4.1 and above.
Both depth_first_search and the vertices function are templated, and not instantiated until transitive_closure is called, so I'm at a loss to explain why the order of these two includes is causing gcc to get confused.
I don't think it is confused, it just checks these templates at the point of definition, and not at the point of instantiation.
Does anyone object if I commit this fix (removing the depth_first_search include) to clear up these test failures?
Not me, this fix might even clear the failures for Tru64/CXX. Thanks, Markus
participants (2)
-
Aaron Windsor
-
Markus Schöpflin