re PR c++/32519 (g++ allows access to protected template member functions of base...
authorJason Merrill <jason@gcc.gnu.org>
Fri, 28 Nov 2008 22:24:49 +0000 (17:24 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 28 Nov 2008 22:24:49 +0000 (17:24 -0500)
        PR c++/32519
        * g++.dg/template/pr32519.C: New test.

From-SVN: r142264

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

diff --git a/gcc/testsuite/g++.dg/template/pr32519.C b/gcc/testsuite/g++.dg/template/pr32519.C
new file mode 100644 (file)
index 0000000..e93c7b4
--- /dev/null
@@ -0,0 +1,16 @@
+// PR 32519
+// { dg-do compile }
+
+struct B
+{
+protected:
+  template <class T> void f (); // { dg-error "protected" }
+};
+
+struct D : public B
+{
+  void g (B* b)
+  {
+    b->f<int> (); // { dg-error "context" }
+  }
+};