view gcc/testsuite/g++.dg/opt/crash1.C @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line source

// PR opt/13681
// Here we have an out-of-range array index.  We should not abort
// trying to resolve the indirection back to an object.

struct X { 
    double values[1]; 
    double & foo (const unsigned int index) { return values[index]; } 
}; 
 
void foo() { 
  double d; 
  X h1; 
  h1.foo(1) = d; 
}