[Bug c++/12992] New: internal compiler error: segmentation fault for g++

scamel at elte dot hu gcc-bugzilla@gcc.gnu.org
Mon Nov 10 13:12:00 GMT 2003


Compiling ends with segfault for the following simple code (tested on 
several Linux 2.4 machines: Slackware, Suse, Debian):
---------------------------------------------------------------------

template <int v> struct Int2Type {
        enum { value = v };
};

struct MyPtr { int getInt() { return 0; } };

template <class Type> Int2Type< sizeof(&Type::getInt) > NameDefined() {
        return Int2Type< sizeof(&Type::getInt) >();
}

template <class Type> Int2Type<0> NameDefined(...) {
        return Int2Type<0>();
}

int main() {
        NameDefined<MyPtr>().value;
        return 0;
}

-- 
           Summary: internal compiler error: segmentation fault for g++
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: scamel at elte dot hu
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12992



More information about the Gcc-bugs mailing list