Using friend functions into template<> classes, I get an internal error. GNU C++ version 4.0.1 (Apple Computer, Inc. build 5363) (powerpc-apple-darwin8) compiled by GNU C version 4.0.1 (Apple Computer, Inc. build 5363). GGC heuristics: --param ggc-min-expand=65 --param ggc-min-heapsize=65536 Compiler executable checksum: ce9235a98d7fdb10daff64ff72fa17f5 ../../include/viewAsGraph.hh: In instantiation of 'viewAsGraph<std::vector<edgeTest, std::allocator<edgeTest> > >': ../src/viewAsGraphTest.cc:21: instantiated from here ../../include/viewAsGraph.hh:153: internal compiler error: Bus error Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://developer.apple.com/bugreporter> for instructions.
Created attachment 12107 [details] .ii and .log (stdout/stderr) files compilation command line: g++ -v --save-temps -g -O0 -I../../include -I. -I../include -I/Volumes/Home/Users/smirolo/workarea/ootbc/mini/include ../src/viewAsGraphTest.cc -o viewAsGraphTest > viewAsGraphTest.log 2>&1
Actually, I have the following two definitions: friend vertex_descriptor source<>( const edge_descriptor& e, const viewAsGraph& g ); friend const vertex_descriptor& source<>( const edge_descriptor& e, const viewAsGraph& g ); This is an error as both function have the same prototype according to C++. None the less, the compiler should report an error message and not an internal error in my opinion.
This works in 4.1.0.
(In reply to comment #3) > This works in 4.1.0. Meaning it does not ICE. ../../include/viewAsGraph.hh: In instantiation of ‘viewAsGraph<std::vector<edgeTest, std::allocator<edgeTest> > >’: ../src/viewAsGraphTest.cc:21: instantiated from here ../../include/viewAsGraph.hh:153: error: ambiguous template specialization ‘source<>’ for ‘const int& source(const edgeTest&, const viewAsGraph<std::vector<edgeTest, std::allocator<edgeTest> > >&)’ ../../include/viewAsGraph.hh:159: error: ambiguous template specialization ‘target<>’ for ‘const int& target(const edgeTest&, const viewAsGraph<std::vector<edgeTest, std::allocator<edgeTest> > >&)’ ../../include/viewAsGraph.hh:166: error: template-id ‘put<>’ for ‘void put(boost::default_color_type*, const int&, boost::default_color_type)’ does not match any template declaration ../../include/viewAsGraph.hh:169: error: template-id ‘get<>’ for ‘boost::default_color_type get(boost::default_color_type*, const int&)’ does not match any template declaration ../src/viewAsGraphTest.cc: In function ‘int main(int, char**)’: ../src/viewAsGraphTest.cc:22: error: call of overloaded ‘source(edgeTest, main(int, char**)::graphType&)’ is ambiguous
Note since this is an Apple compiler you found this bug in, you should have reported this to Apple first and not to the FSF. Specificially you did not read the output the compiler gave: See <URL:http://developer.apple.com/bugreporter> for instructions.
Fixed in 4.1.0.