[Bug c++/20208] New: [4.0 Regression] No array-to-pointer decay happens for template functions

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Fri Feb 25 19:35:00 GMT 2005


At -O1 and above, the following code ICE because well, the same reason why PR 2892 fails currently 
really:
extern "C" void abort();

template <typename T>
inline void *Foo (T arg) { return &arg[0]; }

int main () {
  int bry[2];
  if (Foo<int[2]>(bry) != bry)
    abort();
}

I filed this a seperate bug because well the ICE is a regression even though fixing PR 2892 will fix this 
also.

-- 
           Summary: [4.0 Regression] No array-to-pointer decay happens for
                    template functions
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
OtherBugsDependingO 2892
             nThis:


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



More information about the Gcc-bugs mailing list