This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]