Created on 2014-06-19.00:00:00 last changed 11 months ago
Additional note (January, 2024)
The example is ill-formed per the resolution of issue 1862 (adopted in November, 2017).
During the discussion of issue 1918, it was decided that the last part of the issue should be split off into a separate issue. According to 13.7.5 [temp.friend] paragraph 5,
A member of a class template may be declared to be a friend of a non-template class.
Does this make the example from issue 1918,
template<typename T> struct A { class B { class C {}; }; }; class X { static int x; template <typename T> friend class A<T>::B::C; }; template<> struct A<int> { typedef struct Q B; }; struct Q { class C { int f() { return X::x; } }; };
ill-formed because the friend declaration does not refer to a member of a class template? This does not appear to be the interpretation chosen by most implementations.
History | |||
---|---|---|---|
Date | User | Action | Args |
2024-01-13 12:51:15 | admin | set | messages: + msg7569 |
2024-01-13 12:51:15 | admin | set | status: open -> cd5 |
2014-06-19 00:00:00 | admin | create |