Bug 28863

Summary: ICE on template class with visibility specification
Product: gcc Reporter: Bernardo Innocenti <bernie>
Component: c++Assignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED DUPLICATE    
Severity: normal CC: bernie, fang, gcc-bugs, jason, mark, mueller, tbm
Priority: P3 Keywords: ice-on-valid-code
Version: 4.1.1   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: 4.2.0 Last reconfirmed:

Description Bernardo Innocenti 2006-08-27 01:56:47 UTC
The following testcase:

 template<class T> class __attribute__((visibility("default"))) Foo
 {
   Foo<T> bar();
 };

 template<class T> Foo<T> Foo<T>::bar()
 {
 }

Produces:

 foo.cpp: In member function &#8216;Foo<T> Foo<T>::bar()&#8217;:
 foo.cpp:6: internal compiler error: Segmentation fault
Comment 1 Andrew Pinski 2006-08-27 02:07:29 UTC
This works for me with "4.2.0 20060823" and "4.1.2 20060814" on "i686-pc-linux-gnu".
Comment 2 David Fang 2006-08-27 07:45:33 UTC
Looks recently fixed by patch for PR 28659.  
Comment 3 Andrew Pinski 2006-08-27 15:41:29 UTC
You must have something backported to 4.1.x because the patch which orginally caused this was only on the mainline.

*** This bug has been marked as a duplicate of 28659 ***