OSDN Git Service

Scan "lea\[lq\]?\[ \t\]" instead of "lea\[ \t\]".
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.law / visibility13.C
index 7f634e2..025b0b1 100644 (file)
@@ -1,4 +1,4 @@
-// Build don't link: 
+// { dg-do assemble  }
 // GROUPS passed visibility
 // visibility file
 // From: dinh@cs.ucla.edu (Dinh Le)
@@ -6,15 +6,17 @@
 // Subject:  class, template and their scoping problem
 // Message-ID: <9307130521.AA18312@oahu.cs.ucla.edu>
 
-#include <iostream.h>
-#include <assert.h>
+#include <iostream>
+#include <cassert>
 
 //     ---------------   Array.h  &&  Array.cc   ------------------
 
+using namespace std;
+
 const int ArraySize = 12;
 
 template <class Type>
-class Array { // ERROR - .struct Array_RC redecl.*
+class Array { // { dg-error "" } .struct Array_RC redecl.*
 friend class Array_RC;
 public:
     Array(const Type *ar, int sz) { init(ar,sz); }
@@ -23,8 +25,8 @@ public:
     virtual Type& operator[](int ix) { return ia[ix]; }
 private:
     void init(const Type*, int);
-    int size; // ERROR - private
-    int *ia; // ERROR - private
+    int size;
+    int *ia;
 };
 
 template <class Type>
@@ -63,7 +65,7 @@ void Array<Type>::init(const Type *array, int sz)
 //     ---------------   Array_RC.h  &&  Array_RC.cc   ----------------
 
 template <class Type>
-class Array_RC : public Array<Type> {// ERROR - previous declaration.*
+class Array_RC : public Array<Type> {
 public:
     Array_RC(const Type *ar, int sz);
     Type& operator[](int ix);
@@ -74,8 +76,8 @@ Array_RC<Type>::Array_RC(const Type *ar, int sz) : Array<Type>(ar, sz) {}
 
 template <class Type>
 Type &Array_RC<Type>::operator[](int ix) {
-    assert(ix >= 0 && ix < size);// ERROR - member .size.*
-    return ia[ix];// ERROR - member .ia.*
+    assert(ix >= 0 && ix < size);// { dg-error "" } member .size.*
+    return ia[ix];// { dg-error "" } member .ia.*
 }
 
 //    -------------------   Test routine   ----------------------
@@ -97,7 +99,7 @@ try_array( Array_RC<Type> &rc )
 int main()
 {
     static int ia[10] = { 12, 7, 14, 9, 128, 17, 6, 3, 27, 5 };
-    Array_RC<int> iA(ia, 10);// ERROR - instantiated from here
+    Array_RC<int> iA(ia, 10);
 
     cout << "template Array_RC class" << endl;
     try_array(iA);