aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.old-deja/g++.martin/sts_conv.C
blob: 93cad839f7070499401fade163d640439abe431e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// { dg-do run  }
// ecgs-bugs 1999-02-22 14:21, Stefan Schwarzer 
// sts@ica1.uni-stuttgart.de
// this code should compile quietly

class CArray 
{
public:
  operator double* (){ return a; }
  // works if we comment this line:
  operator double* () const { return const_cast<double *>(a); }
private:   
  double      a[2];   
};

int main(){
  CArray  a;
  double *pa = a + 1; // { dg-bogus "" } should convert
  return 0; 
}