gcc/testsuite/g++.dg/template/crash69.C
raw| 1 | // PR c++/31132 |
| 2 | |
| 3 | template<typename T> class A |
| 4 | { |
| 5 | static int i; // { dg-message "private" } |
| 6 | friend int T::foo(); // { dg-error "no declaration matches" } |
| 7 | }; |
| 8 | |
| 9 | struct B |
| 10 | { |
| 11 | void foo() { A<B>::i; } // { dg-message "candidate" } |
| 12 | // { dg-error "private within" "" { target *-*-* } .-1 } |
| 13 | }; |