update
authorJason Merrill <jason@gcc.gnu.org>
Sun, 27 Feb 2000 06:54:06 +0000 (01:54 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Sun, 27 Feb 2000 06:54:06 +0000 (01:54 -0500)
From-SVN: r32213

gcc/testsuite/g++.old-deja/g++.benjamin/14687.C
gcc/testsuite/g++.old-deja/g++.benjamin/scope01.C
gcc/testsuite/g++.old-deja/g++.brendan/misc15.C
gcc/testsuite/g++.old-deja/g++.jason/template18.C
gcc/testsuite/g++.old-deja/g++.law/visibility26.C
gcc/testsuite/g++.old-deja/g++.other/lookup18.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.other/using2.C
gcc/testsuite/g++.old-deja/g++.other/using4.C
gcc/testsuite/g++.old-deja/g++.other/using6.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.pt/memtemp89.C

index c2a9a99d0c292294ecd93eaf2bbc82fdd1004772..6897fe943a46146b039dda548a68aa8cf96ef40a 100644 (file)
@@ -1,6 +1,5 @@
 // 981203 bkoz
 // g++/14687
-// excess errors test - XFAIL *-*-*
 
 #include <assert.h>
 unsigned int gtest;
index a834f4f49561ac74517e9e0ca6cb0f5d82a62592..582723ab9f9f8febcc8078ade8067ec83c7da793 100644 (file)
@@ -19,8 +19,8 @@ class C : public A, public B {};
 void foo() {
   // straight call
   C x;
-  x.A::ii = 5;
-  x.A::foo(x.A::ii);
+  x.A::ii = 5;                 // ERROR - L is ambiguous base
+  x.A::foo(x.A::ii);           // ERROR - L is ambiguous base
   
   // 5.1 Primary expressions
   // p 8 
index e4dd53e0994d7e31f596125f2ed1228d07ae5f80..30c4feb42a2117cc5a9e1ff2e250368c7b806cb5 100644 (file)
@@ -1,6 +1,6 @@
 // Build don't link: 
 // GROUPS passed miscellaneous-bugs
-// we shouldn't get any warnings or errors for this code
+
 struct A {
         int     aa;
 };
@@ -9,5 +9,5 @@ struct B : public A {
 struct C : public A {
 };
 struct D : public C, public B {
-        void fun() { C::aa = 10; }
+        void fun() { C::aa = 10; } // ERROR - conversion to A is ambiguous
 };
index 38224bfd5ee13a8299d6e6c9af299164fc26681c..d736826a9e53d33f2dd051bdef0efc8b85b4ede3 100644 (file)
@@ -1,6 +1,6 @@
 // GROUPS passed templates
 // Bug: g++ emits template instances when it shouldn't.
-// Special g++ Options: -g -Wno-deprecated -fexternal-templates
+// Special g++ Options: -g -O0 -Wno-deprecated -fexternal-templates
 
 // We mark this XFAIL because we can't test for expected linker errors.
 // If we get an XPASS for this testcase, that's a bug.
index 54fc43e2053bce861f0f28f086832d8982563f50..ba1299d29993f78466bf464a261b62a6e19648fb 100644 (file)
@@ -13,6 +13,6 @@ class X {
 
 class Y : private X {
   public:
-    void f(int);// ERROR -    because.*
-    X::f;  // g++ 2.5.5 doesn't flag this misuse
-};// ERROR -  cannot adjust.*
+    void f(int);
+    X::f;  // used to be an error; now equivalent to 'using X::f'
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup18.C b/gcc/testsuite/g++.old-deja/g++.other/lookup18.C
new file mode 100644 (file)
index 0000000..bec78f8
--- /dev/null
@@ -0,0 +1,23 @@
+// Test that referring to an ambiguous base in name lookup does not
+// interfere with accessing the field, which is not ambiguous.
+
+// Build don't link:
+
+struct A {
+  int i;
+};
+struct B: virtual A { };
+struct C: public B { };
+struct D: public B { };
+struct E: public C, public D {
+  void f ();
+};
+
+void E::f() {
+  B::i = 0;
+}
+
+void f () {
+  E e;
+  e.B::i = 0;
+}
index 2924498e35a1e67f6aef9e85ad0beb1450475e83..cb457bfafb4ebd8d906e049eb8e171c140f47d07 100644 (file)
@@ -5,6 +5,6 @@ struct X{
 
 struct Y:X{
   void f(int);
-  void f();         // ERROR - conflict
+  void f();
   using X::f;
-};                  // ERROR - 
+};
index 218ffe2a85c331c7dd29cb3717a0fda9c214d5e8..bb653e491ee32f3ee18d696f78c4eb2279b68c3a 100644 (file)
@@ -2,8 +2,6 @@
 
 // Based on a testcase by Martin Bachtold <martinb@coyotesystems.com>
 
-// excess errors test - XFAIL *-*-*
-
 struct foo {
   void m();
 };
diff --git a/gcc/testsuite/g++.old-deja/g++.other/using6.C b/gcc/testsuite/g++.old-deja/g++.other/using6.C
new file mode 100644 (file)
index 0000000..40b21b5
--- /dev/null
@@ -0,0 +1,29 @@
+// Test of class-scope using-declaration for functions.
+
+#define assert(COND) if (!(COND)) return 1
+
+struct A {
+  int f(int) { return 1; }
+  int f(char) { return 2; }
+};
+
+struct B {
+  int f(double) { return 3; }
+};
+
+struct C : public A, public B {
+  using A::f;
+  using B::f;
+  int f(char) { return 4; }
+  int f(C) { return 5; }
+};
+
+int main ()
+{
+  C c;
+
+  assert (c.f(1) == 1);
+  assert (c.f('a') == 4);
+  assert (c.f(2.0) == 3);
+  assert (c.f(c) == 5);
+}
index 7cc027a4859a05f1410ad77e064674f07e713586..768b374c2801e2d58351e583b20a98f68f222057 100644 (file)
@@ -1,5 +1,4 @@
 // Build don't link:
-// crash test - XFAIL *-*-*
 
 // by Paul Burchard <burchard@pobox.com>, Level Set Systems, Inc.
 // Copyright (C) 1999 Free Software Foundation
@@ -11,7 +10,7 @@ class Q {
 };
 template<template<class> class XX>
 class Y {
-       XX<int> x_;
+       XX<int> x_;             // ERROR - Q::X not a template
 };
-Y<Q::X> y;
+Y<Q::X> y;                     // ERROR - instantiated from here