Bug 12489 - ICE in walk_tree: same name for struct and a templated member function of another class
Summary: ICE in walk_tree: same name for struct and a templated member function of ano...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.2.3
: P2 normal
Target Milestone: 3.3
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2003-10-02 01:26 UTC by Shai Hirsch
Modified: 2005-07-23 22:49 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shai Hirsch 2003-10-02 01:26:29 UTC
Compiling the following simple code snippet causes an ICE

struct foo { }; 
struct A { template <class P> P foo() {} };

int main() 
{ 
  A::foo(); 
  return 0; 
}

[mozart] test > uname -a
Linux mozart.shai.home 2.4.19-lac #1 Thu Aug 15 18:07:38 MDT 2002 i686 unknown

[mozart] test > g++ -v
Reading specs from /usr/local/lib/gcc33/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/specs
Configured with: ../configure --prefix /usr/local/lib/gcc33
Thread model: posix
gcc version 3.2.3

[mozart] test > g++ gcc_bug.C
gcc_bug.C: In function `int main()':
gcc_bug.C:4: Internal compiler error in walk_tree, at tree-inline.c:1326
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

When commenting out struct foo{}; the  expected error message (no matching
function for call to `foo()') appears.
Comment 1 Andrew Pinski 2003-10-02 01:28:50 UTC
Already fixed in 3.3.1 and the mainline.