comparison gcc/testsuite/g++.old-deja/g++.law/visibility13.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
13 13
14 using namespace std; 14 using namespace std;
15 15
16 const int ArraySize = 12; 16 const int ArraySize = 12;
17 17
18 template <class> class Array_RC;
19
18 template <class Type> 20 template <class Type>
19 class Array { // { dg-error "" } .struct Array_RC redecl.* 21 class Array {
20 friend class Array_RC; 22 friend class Array_RC<Type>;
21 public: 23 public:
22 Array(const Type *ar, int sz) { init(ar,sz); } 24 Array(const Type *ar, int sz) { init(ar,sz); }
23 virtual ~Array() { delete [] ia; } 25 virtual ~Array() { delete [] ia; }
24 virtual void print(ostream& = cout); 26 virtual void print(ostream& = cout);
25 virtual Type& operator[](int ix) { return ia[ix]; } 27 virtual Type& operator[](int ix) { return ia[ix]; }
74 template <class Type> 76 template <class Type>
75 Array_RC<Type>::Array_RC(const Type *ar, int sz) : Array<Type>(ar, sz) {} 77 Array_RC<Type>::Array_RC(const Type *ar, int sz) : Array<Type>(ar, sz) {}
76 78
77 template <class Type> 79 template <class Type>
78 Type &Array_RC<Type>::operator[](int ix) { 80 Type &Array_RC<Type>::operator[](int ix) {
79 assert(ix >= 0 && ix < size);// { dg-error "" } member .size.* 81 assert(ix >= 0 && ix < this->size);
80 return ia[ix];// { dg-error "" } member .ia.* 82 return this->ia[ix];
81 } 83 }
82 84
83 // ------------------- Test routine ---------------------- 85 // ------------------- Test routine ----------------------
84 86
85 template <class Type> 87 template <class Type>