c++: robustify testcase [PR109752]
[official-gcc.git] / gcc / testsuite / g++.dg / template / access34.C
blobec79f87e624858406a0719d159748f96d4085190
1 // PR c++/58993
2 // { dg-do compile }
4 class base { void foo(); };
6 template <class T>
7 struct bar : public base {
8   void f1() {
9     &base::foo;  // { dg-error "private" }
10   }
12   template <class>
13   void f2() {
14     &base::foo;  // { dg-error "private" }
15   }
17   void f3();
20 template <class T>
21 void bar<T>::f3() {
22   (void) &base::foo; // { dg-error "private" }
25 int main() {
26   bar<int>().f1();
27   bar<int>().f2<int>();
28   bar<int>().f3();