The following invalid code snippet triggers an ICE since GCC 4.0.0:

========================================
template<int> struct A;

int i = sizeof(A<typeid>);
========================================

bug.cc:3: error: `typeid' operator cannot appear in a constant-expression
bug.cc:3: error: template argument 1 is invalid
*** glibc detected *** double free or corruption (out): 0x00000000009e51c0 ***
bug.cc:3: internal compiler error: Aborted
Please submit a full bug report, [etc.]


-- 
           Summary: [4.0/4.1/4.2 regression] ICE with "typeid" as template
                    parameter
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, error-recovery, monitored
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


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

Reply via email to