1 /* { dg-do compile } */ 2 3 /* Testcase by Martin Michlmayr <tbm@cyrius.com> */ 4 5 extern double cos (double x); 6 7 class bend_class 8 { 9 double *s_A; 10 public: set_s_A(double s_A0)11 void set_s_A (double s_A0) 12 { 13 s_A[0] = s_A0; 14 } 15 }; 16 class bend_set 17 { 18 bend_class *bend_array; 19 public: set_s_A(int index,double s_A0)20 void set_s_A (int index, double s_A0) 21 { 22 bend_array[index].set_s_A (s_A0); 23 } compute_s(void)24 void compute_s (void) 25 { 26 int i, j; 27 double val; 28 double tmp[3]; 29 for (i = 0; i < 5; ++i) 30 { 31 val = i; 32 for (j = 0; j < 2; ++j) 33 tmp[j] = cos (val); 34 set_s_A (i, tmp[0]); 35 tmp[j] = cos (val); 36 } 37 } 38 }; 39 class internals 40 { 41 bend_set bend; 42 void compute_s (void); 43 }; 44 void compute_s(void)45internals::compute_s (void) 46 { 47 bend.compute_s (); 48 } 49 50