This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/52849] New: crash when using suscript operator in delctype argument


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: unassigned@gcc.gnu.org
        ReportedBy: freunddeslichts@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;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]