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

             Bug #: 52849
           Summary: crash when using suscript operator in delctype
                    argument
    Classification: Unclassified
           Product: gcc
           Version: 4.4.7
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: freunddeslic...@web.de


// the following compile crashes 
// $> g++-4.4 -std=c++0x gcc44_bug.cpp
// it works in 4.5, but I'm writing a library that must work on all versions
// exact version is 4.4.7 (Ubuntu/Linaro 4.4.7-1ubuntu1) on 32 bit Linux

template <class T>
auto bug(T* t) -> decltype(t[0])
{
  return *t;
}


int main(void)
{
  int i;
  bug(&i);

  return 0;
}

Reply via email to