Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.martin/sts_conv.C

raw
1 // { dg-do run }
2 // ecgs-bugs 1999-02-22 14:21, Stefan Schwarzer
3 // [email protected]
4 // this code should compile quietly
5
6 class CArray
7 {
8 public:
9 operator double* (){ return a; }
10 // works if we comment this line:
11 operator double* () const { return const_cast<double *>(a); }
12 private:
13 double a[2];
14 };
15
16 int main(){
17 CArray a;
18 double *pa = a + 1; // { dg-bogus "" } should convert
19 return 0;
20 }