gcc/testsuite/g++.dg/modules/friend-8_a.H
raw| 1 | // PR c++/114889 |
| 2 | // { dg-additional-options "-fmodule-header" } |
| 3 | // { dg-module-cmi {} } |
| 4 | |
| 5 | template<class, class> |
| 6 | struct _Hashtable; |
| 7 | |
| 8 | template<class _Key, class _Val> |
| 9 | struct _Map_base { |
| 10 | void f() { |
| 11 | _Hashtable<_Key, _Val> __h; |
| 12 | __h._M_hash_code(0); |
| 13 | } |
| 14 | }; |
| 15 | |
| 16 | template<class _Key, class _Value> |
| 17 | struct _Hashtable { |
| 18 | template<class, class> friend struct _Map_base; |
| 19 | protected: |
| 20 | void _M_hash_code(int); |
| 21 | }; |
| 22 | |
| 23 | inline _Hashtable<int, int> m; |