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

Reply via email to