search.c (lookup_base_r): Don't clear is_non_public just because we found a friendly...
authorJason Merrill <jason@gcc.gnu.org>
Thu, 28 Feb 2002 15:46:31 +0000 (10:46 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 28 Feb 2002 15:46:31 +0000 (10:46 -0500)
        * search.c (lookup_base_r): Don't clear is_non_public just because
        we found a friendly scope.

From-SVN: r50143

gcc/testsuite/g++.dg/inherit/access2.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/inherit/access2.C b/gcc/testsuite/g++.dg/inherit/access2.C
new file mode 100644 (file)
index 0000000..2477994
--- /dev/null
@@ -0,0 +1,14 @@
+// Test that a base doesn't get special rights to convert to itself.
+
+struct A {
+  void f ();
+};
+
+struct B: private A { };
+
+B b;
+
+void A::f ()
+{
+  A* ap = &b;                  // { dg-error "base|inherit" "" }
+}