The following invalid code snippet triggers an ICE on mainline:

===============================
template<typename T> struct A
{
  __decltype (T* foo());
};
===============================

bug.cc:3: error: expected primary-expression before '*' token
bug.cc:3: error: there are no arguments to 'foo' that depend on a template
parameter, so a declaration of 'foo' must be available
bug.cc:3: error: (if you use '-fpermissive', G++ will accept your code, but
allowing the use of an undeclared name is deprecated)
bug.cc:3: internal compiler error: Segmentation fault
Please submit a full bug report, [etc.]

The problem appeared between 2007-07-16 and 2007-08-15, presumably with
the introduction of decltype:

2007-07-27  Douglas Gregor  <[EMAIL PROTECTED]>

        * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
        * cp-tree.def (DECLTYPE_TYPE): New.
        * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
        ...


-- 
           Summary: [4.3 regresssion] ICE with invalid use of decltype
           Product: gcc
           Version: 4.3.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=33838

Reply via email to