Bug 26665 - Gcc segmentation fault
Summary: Gcc segmentation fault
Status: RESOLVED DUPLICATE of bug 23797
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.0.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-13 14:46 UTC by David Zhao
Modified: 2006-03-13 15:02 UTC (History)
7 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 David Zhao 2006-03-13 14:46:40 UTC
My code is:
//-----------------------------------------------
#include <iostream>

template < int I >
struct _integer { 
    enum { _value = I };
    typedef _integer<_value> _type;
};

#define _I(Int) \
    typename _integer<Int>::_type

template< class type >
void hi(type) {
    std::cout << std::endl;
}

int main() {
  hi(_I(1)()); //Bug report here.
  return 0;
}
//-------------------------------------------
And my gcc command is:
    g++ -O2 test.cpp -o test
//-------------------------------------------
The bug report is:
test.cpp: In function ‘int main()’:
test.cpp:72: internal compiler error: Segmentation fault
Comment 1 Andrew Pinski 2006-03-13 15:02:19 UTC
This was fixed in 4.0.3 see PR 23797.

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