Bug 28785 - internal compiler error
Summary: internal compiler error
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.0.1
: P3 normal
Target Milestone: 4.1.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2006-08-20 18:55 UTC by Sebastien Mirolo
Modified: 2006-09-03 05:39 UTC (History)
3 users (show)

See Also:
Host: powerpc-apple-darwin8
Target: powerpc-apple-darwin8
Build: powerpc-apple-darwin8
Known to work:
Known to fail:
Last reconfirmed:


Attachments
.ii and .log (stdout/stderr) files (168.12 KB, application/octet-stream)
2006-08-20 18:57 UTC, Sebastien Mirolo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastien Mirolo 2006-08-20 18:55:43 UTC
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.
Comment 1 Sebastien Mirolo 2006-08-20 18:57:39 UTC
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
Comment 2 Sebastien Mirolo 2006-08-20 19:06:30 UTC
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.


Comment 3 Andrew Pinski 2006-08-21 01:27:46 UTC
This works in 4.1.0.
Comment 4 Andrew Pinski 2006-08-21 01:31:02 UTC
(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
Comment 5 Andrew Pinski 2006-08-21 05:15:48 UTC
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.
Comment 6 Andrew Pinski 2006-09-03 05:39:19 UTC
Fixed in 4.1.0.