c++: robustify testcase [PR109752]
[official-gcc.git] / gcc / testsuite / g++.dg / template / memfriend18.C
blobac21896e0a2a9bcd21509d6ebec8c5fceebde033
1 // PR c++/87571
3 template <class> struct A {
4   template <class> struct B {
5     template <class> friend class B;
6   protected:
7     int protected_member_;
8   public:
9     template <class T> int method(const B<T>& other) const {
10       return other.protected_member_;
11     }
12   };
15 int main() {
16   A<int>::B<int> a;
17   A<int>::B<char> b;
18   a.method(b);