]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
update
authorJason Merrill <jason@gcc.gnu.org>
Mon, 7 Feb 2000 20:35:14 +0000 (15:35 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 7 Feb 2000 20:35:14 +0000 (15:35 -0500)
From-SVN: r31836

gcc/testsuite/g++.old-deja/g++.bob/nested1.C
gcc/testsuite/g++.old-deja/g++.brendan/enum6.C
gcc/testsuite/g++.old-deja/g++.brendan/nest11.C
gcc/testsuite/g++.old-deja/g++.jason/report.C
gcc/testsuite/g++.old-deja/g++.law/arm14.C
gcc/testsuite/g++.old-deja/g++.mike/p8785.C [deleted file]
gcc/testsuite/g++.old-deja/g++.mike/pmf2.C
gcc/testsuite/g++.old-deja/g++.other/access7.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.pt/dynarray.C
gcc/testsuite/g++.old-deja/g++.pt/explicit72.C

index b5b7a762e0fc85cc2ebf6b17486ea41110aa06bf..aacfef4b4ac1d2667ef91f98ceef354120049c50 100644 (file)
@@ -1,15 +1,16 @@
 // Build don't link: 
-  class A {
-    class B {
-      typedef long T;
-      int i;
-    };
+
+struct A {
+  struct B {
+    typedef long T;
+    int i;
   };
-  class C {
-    class B {
-      typedef float T;
-      int i;
-    };
+};
+struct C {
+  struct B {
+    typedef float T;
+    int i;
   };
+};
 
 C::B::T a;
index 8c5c9ad9299d8e3bc15ab4fb8efa7b733134474c..8e1a6df7a7b8efe350a60dee965a9534d2cfba4f 100644 (file)
@@ -11,6 +11,6 @@ void h(X* p) {
     X::E2 e2;
     int x2 = X::a2;
 
-    X::E1 e1;
+    X::E1 e1;       // ERROR - within this context
     int x1 = X::a1;  // ERROR - within this context
     }
index 4a57b38385840e835db00fadf4d43256bd029227..8a5de0fa2481e9f04351a464285d2db146007697 100644 (file)
@@ -6,6 +6,8 @@ class A {
   struct B {
     int x;
   };
+  struct C;
+  friend struct C;
   struct C {
     int bug (A::B &y);
   };
index e514ae75a6d2857167e9590e56c79f8d5cabfc9f..ed4d1836b2b118f1f6c194ecdddcf42a0fec3697 100644 (file)
@@ -38,15 +38,15 @@ int foo2 (int (*a)(int) = &foo)
 }
 
 class X{
-  class Y{};
+  class Y{};                   // ERROR - private
 };
 
 typedef int const * bart ();
 typedef bart const * const * bar2; // ERROR - qualifiers
 
 bar2 baz (X::Y y)
-{
-  X::Y f;
+{                              // ERROR - in this context
+  X::Y f;                      // ERROR - in this context
   bar2 wa [5];
   wa[0] = baz(f);
   undef2 (1); // ERROR - implicit declaration
index d50b3cdfd9bbc5f0c6d3ac89dbca94f87770ade0..d4195d24f5e10b1afb1bb6372456ba7daf87677f 100644 (file)
@@ -18,7 +18,7 @@ void h(X* p) {
     X::E2 e2;
     int x2 = X::a2;
 
-    X::E1 e1;                   // Should be rejected, but isn't.// ERROR - .* , XFAIL *-*-*
+    X::E1 e1;                   // ERROR - within this context
     int x1 = X::a1;             // ERROR - Should be rejected, and is.
     }
 
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8785.C b/gcc/testsuite/g++.old-deja/g++.mike/p8785.C
deleted file mode 100644 (file)
index e10f4cf..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-// Build don't link:
-// prms-id: 8785
-
-class Outer {
-private:
-  int x; // ERROR - private
-public:
-  struct Inner {
-    int y;
-    void f( Outer * p, int i) {
-      p->x = i;                        // ERROR - 
-    };
-    void f( Outer & p) {
-      p.x = y;                 // ERROR - 
-    };
-  };
-};
-
-int main() {
-  Outer::Inner A;
-  Outer Thing;
-
-  A.f(Thing);
-  A.f(&Thing,2);
-}
index 5a5aa0667b6c6f64066569ac6e84acb7e12b847b..e50f47242dc266d4c45b5219f6d070a86191c78b 100644 (file)
@@ -8,8 +8,8 @@ public:
 };
 
 class B_table : private A_table {
-  typedef void (B_table::* B_ti_fn) (int &item);
 public:
+  typedef void (B_table::* B_ti_fn) (int &item);
   B_table() { j = 0x4321;}
   virtual void call_fn_fn1(int &item, void *pfn1);
   void func1(int &item) { printf("func1(%d)\n",item);}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/access7.C b/gcc/testsuite/g++.old-deja/g++.other/access7.C
new file mode 100644 (file)
index 0000000..5566d35
--- /dev/null
@@ -0,0 +1,33 @@
+// Test that access control for types and statics works properly
+// with nested types.
+
+// Build don't link:
+
+class A {
+  static int I1;               // ERROR - private
+  struct B1 { };               // ERROR - private
+public:
+  static int I2;
+  struct B2 { };
+};
+
+class D: public A {
+  struct E {
+    void f ();
+  };
+};
+
+void D::E::f ()
+{
+  int i = I1;                  // ERROR - within this context
+  B1 b1;                       // ERROR - within this context
+  i = I2;
+  B2 b2;
+}
+
+void f ()
+{
+  A::B1 b1;                    // ERROR - within this context
+  new A::B1;                   // ERROR - within this context
+  (A::B1) b1;                  // ERROR - within this context
+}
index 3e57b7b3b5ca9523e9cfb51a571b505a874042a1..62371fcef523c4165c43396bf47343a2d167598e 100644 (file)
@@ -1,6 +1,7 @@
 // Build don't link:
 // Special g++ Options: -ansi
 // Origin: Theo Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
+// Special g++ Options:
 
 inline const unsigned& f(unsigned const& a) {
         return a;
index bc9edfb4de7307219d449d3ff4a699fa794b5c2a..6e3e85181fcda95ed0f41245b089cbb040e2eabb 100644 (file)
@@ -3,13 +3,13 @@
 // Adapted by Alexandre Oliva <oliva@dcc.unicamp.br>
 // plain char, signed char and unsigned char are distinct types
 
-template <class X, class Y> class bug {};
-template <class X> class bug<X,char> { typedef char t; };
-template <class X> class bug<X,unsigned char> { typedef unsigned char t; };
-template <class X> class bug<X,signed char> { typedef signed char t; };
-template <class X> class bug<char,X> { typedef char t; };
-template <class X> class bug<unsigned char,X> { typedef unsigned char t; };
-template <class X> class bug<signed char,X> { typedef signed char t; };
+template <class X, class Y> struct bug {};
+template <class X> struct bug<X,char> { typedef char t; };
+template <class X> struct bug<X,unsigned char> { typedef unsigned char t; };
+template <class X> struct bug<X,signed char> { typedef signed char t; };
+template <class X> struct bug<char,X> { typedef char t; };
+template <class X> struct bug<unsigned char,X> { typedef unsigned char t; };
+template <class X> struct bug<signed char,X> { typedef signed char t; };
 
 void foo() {
   bug<int,char>::t();