Public bug reported:

Binary package hint: gcc-4.4


1)
My Ubuntu Release:
Description:    Ubuntu 10.10
Release:        10.10

2)
gcc-4.4:
  Installed: 4.4.4-14ubuntu5
  Candidate: 4.4.4-14ubuntu5
  Version table:
 *** 4.4.4-14ubuntu5 0
        500 http://ubuntu.media.mit.edu/ubuntu/ maverick/main amd64 Packages
        100 /var/lib/dpkg/status


3)

I compiled this program and it causes gcc to segfault:
#include <iostream>

using namespace std;
class obj1 {
public:
    void do_something () { cout << "hello world" << endl; }
};

template <typename U>
class obj2 
{
public:

    template < typename T >
    void set ( 
        void (T::*cb)() 
    ) { std::cout << __PRETTY_FUNCTION__; }
};

int main()
{
    obj2<int> o2;
    o2.set(&obj1::do_something);
}


When compiled with the statement 'g++ program.cpp' the result is the following:
In member function ‘void obj2<U>::set(void (T::*)()) [with T = obj1, U = int]’:
cc1plus: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.4/README.Bugs> for instructions.


I have also attached the fully preprocessed source code.

** Affects: gcc-4.4 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
using __PRETTY_FUNCTION__ causes gcc to segfault
https://bugs.launchpad.net/bugs/668065
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to