-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CWG2917 [temp.friend] Some variadic template friend declarations should be explicitly ill-formed. #593
Comments
Integrated with CWG2917. |
Thanks! template <typename ...Ts>
struct S {
template <typename>
friend class Foo<Ts>::Nested...;
}; This seems fine (and it is a template declaration and a pack expansion) |
Maybe: If there is a top-level pack expansion, any packs expanded by that pack expansion shall not have been introduced by the template-declaration. |
Why do we want to ban this example? It has a natural interpretation that |
CWG2917 is fixed |
Consider
Here
#1
declares a template friend declaration such thatFoo<T>::Nested
is a friend of S for any T, perhttps://eel.is/c++draft/temp.friend#4 and https://eel.is/c++draft/temp.friend#5
However
#2
doesn't really mean anything sensible. Yet there does not seem to be any wording specifying exactly whatvariadic friend declarations are or are not allowed.
P2893 incorrectly claimed that
#1
was ill-formed and consequently did not add wording to make#2
ill-formed.The text was updated successfully, but these errors were encountered: