Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#1318 GCC 4.4.0 ICE if member function of template use local array

OTHER
closed
nobody
gcc (462)
out-of-date
Unknown
2013-01-29
2009-07-15
No

OS Windows Vista Home Basic Ru + sp2
g++ (GCC) 4.4.0
GNU ld (GNU Binutils) 2.19

Code:
template <class T>
struct test_t {
int i;
test_t() : i(10) {}
char f() const {
char buf[this->i]; //internal compiler error: Segmentation fault
return buf[0];
}
};

int main() {
test_t<int> test;
test.f();
}

Console command:
>g++ -c "ice_local_array.cpp"
Output:
ice_local_array.cpp: In member function 'char test_t<T>::f() const [with T = int]':
ice_local_array.cpp:13: instantiated from here
ice_local_array.cpp:6: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Discussion

    • summary: ICE if member function of template use local array --> GCC 4.4.0 ICE if member function of template use local array
     
  • Earnie Boyd
    Earnie Boyd
    2012-06-14

    Testing with 4.6.1 produces an executable. Open a new issue if you are still having problems.

     
  • Earnie Boyd
    Earnie Boyd
    2012-06-14

    • status: open --> closed-out-of-date
     
  • Earnie Boyd
    Earnie Boyd
    2013-01-29

    • status: closed-out-of-date --> closed
    • resolution: --> out-of-date
    • category: --> Unknown
    • milestone: --> OTHER