X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=gcc%2Ftestsuite%2Fg%2B%2B.old-deja%2Fg%2B%2B.law%2Fvisibility13.C;fp=gcc%2Ftestsuite%2Fg%2B%2B.old-deja%2Fg%2B%2B.law%2Fvisibility13.C;h=0000000000000000000000000000000000000000;hb=6fed43773c9b0ce596dca5686f37ac3fc0fa11c0;hp=dbde720d2762301b19a14bf92dc0948f49d09e45;hpb=27b11d56b743098deb193d510b337ba22dc52e5c;p=msp430-gcc.git diff --git a/gcc/testsuite/g++.old-deja/g++.law/visibility13.C b/gcc/testsuite/g++.old-deja/g++.law/visibility13.C deleted file mode 100644 index dbde720d..00000000 --- a/gcc/testsuite/g++.old-deja/g++.law/visibility13.C +++ /dev/null @@ -1,110 +0,0 @@ -// Build don't link: -// GROUPS passed visibility -// visibility file -// From: dinh@cs.ucla.edu (Dinh Le) -// Date: Mon, 12 Jul 93 22:21:06 -0700 -// Subject: class, template and their scoping problem -// Message-ID: <9307130521.AA18312@oahu.cs.ucla.edu> - -#include -#include - -// --------------- Array.h && Array.cc ------------------ - -using namespace std; - -const int ArraySize = 12; - -template -class Array { // ERROR - .struct Array_RC redecl.* -friend class Array_RC; -public: - Array(const Type *ar, int sz) { init(ar,sz); } - virtual ~Array() { delete [] ia; } - virtual void print(ostream& = cout); - virtual Type& operator[](int ix) { return ia[ix]; } -private: - void init(const Type*, int); - int size; // ERROR - private - int *ia; // ERROR - private -}; - -template -ostream& operator<<( ostream& os, Array& ar ) -{ - ar.print(os); - return os; -} - -template -void Array::print(ostream& os) -{ - const int lineLength = 12; - - os << "( " << size << " )< "; - for (int ix = 0; ix < size; ++ix) { - if (ix % lineLength == 0 && ix) os << "\n\t"; - os << ia[ ix ]; - - if (ix % lineLength != lineLength-1 && - ix != size-1) - os << ", "; - } - os << " >\n"; -} - -template -void Array::init(const Type *array, int sz) -{ - ia = new Type[size = sz]; - - for (int ix = 0; ix < size; ++ix) - ia[ix] = (array!=0) ? array[ix] : (Type)0; -} - -// --------------- Array_RC.h && Array_RC.cc ---------------- - -template -class Array_RC : public Array {// ERROR - previous declaration.* -public: - Array_RC(const Type *ar, int sz); - Type& operator[](int ix); -}; - -template -Array_RC::Array_RC(const Type *ar, int sz) : Array(ar, sz) {} - -template -Type &Array_RC::operator[](int ix) { - assert(ix >= 0 && ix < size);// ERROR - member .size.* - return ia[ix];// ERROR - member .ia.* -} - -// ------------------- Test routine ---------------------- - -template -void try_array( Array &iA ) -{ - cout << "try_array: initial array values:\n"; - cout << iA << endl; -} - -template -inline void -try_array( Array_RC &rc ) -{ - try_array( ((Array&)rc) ); -} - -int main() -{ - static int ia[10] = { 12, 7, 14, 9, 128, 17, 6, 3, 27, 5 }; - Array_RC iA(ia, 10);// ERROR - instantiated from here - - cout << "template Array_RC class" << endl; - try_array(iA); - - return 0; -} - -template class Array_RC;