|
16 | 16 | Core Issues List revision 115a.
|
17 | 17 | See http://www.open-std.org/jtc1/sc22/wg21/ for the official
|
18 | 18 | list.</EM></P>
|
19 |
| -<P>2024-08-07</P> |
| 19 | +<P>2024-08-17</P> |
20 | 20 | <HR>
|
21 | 21 | <A NAME="2917"></A><H4>2917.
|
22 | 22 |
|
|
25 | 25 | <B>Section: </B>13.1  [<A href="https://wg21.link/temp.pre">temp.pre</A>]
|
26 | 26 |    
|
27 | 27 |
|
28 |
| - <B>Status: </B>open |
| 28 | + <B>Status: </B>review |
29 | 29 |    
|
30 | 30 |
|
31 | 31 | <B>Submitter: </B>Ambrose T
|
32 | 32 |    
|
33 | 33 |
|
34 |
| - <B>Date: </B>2024-07-30<BR> |
| 34 | + <B>Date: </B>2024-07-30 |
| 35 | +     |
| 36 | + <B>Liaison: </B>EWG<BR> |
35 | 37 |
|
36 | 38 |
|
37 | 39 | <P>(From submissions
|
|
63 | 65 | };
|
64 | 66 | </PRE>
|
65 | 67 |
|
66 |
| -<P><U>Suggested resolution:</U></P> |
| 68 | +<P><B>Proposed resolution (2024-08-16):</B></P> |
67 | 69 |
|
68 | 70 | <P>(<A HREF="2862.html">Issue 2862</A> modifies the same paragraph.)</P>
|
69 | 71 |
|
|
78 | 80 | <INS>In a <I>template-declaration</I> whose <I>declaration</I> is
|
79 | 81 | a <I>friend-type-declaration</I>,
|
80 | 82 | the <I>friend-type-specifier-list</I> shall consist of exactly
|
81 |
| -one <I>friend-type-specifier</I>; if it is a pack expansion |
82 |
| -(13.7.4 [<A href="https://wg21.link/temp.variadic">temp.variadic</A>]), any packs expanded by that pack |
83 |
| -expansion shall not have been introduced by |
84 |
| -the <I>template-declaration</I>. [ Example:</INS> |
| 83 | +one <I>friend-type-specifier</I> that is not a pack expansion. [ |
| 84 | +Example:</INS> |
85 | 85 |
|
86 | 86 | <PRE class="ins">
|
87 | 87 | template<class ...>
|
|
100 | 100 | <INS>-- end example ]</INS>
|
101 | 101 |
|
102 | 102 | </BLOCKQUOTE>
|
| 103 | + |
| 104 | +<P><B>CWG 2024-08-16</B></P> |
| 105 | + |
| 106 | +<P>The proposed resolution above disallows a few examples from paper |
| 107 | +<A HREF="https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2893r3.html">P2893R3</A> |
| 108 | +(Variadic friends), such as |
| 109 | +</P> |
| 110 | + |
| 111 | +<PRE> |
| 112 | + template<class... Ts> |
| 113 | + struct VS { |
| 114 | + template<class U> |
| 115 | + friend class C<Ts>::Nested...; //<SPAN CLASS="cmnt"> now ill-formed</SPAN> |
| 116 | + }; |
| 117 | +</PRE> |
| 118 | + |
| 119 | +<P>The adopted wording for P2893R3 makes |
| 120 | +the <I>friend-type-specifier</I> (not the |
| 121 | +entire <I>template-declaration</I>) the pattern that is expanded by |
| 122 | +the pack expansion, leading to the expansion |
| 123 | +</P> |
| 124 | + |
| 125 | +<PRE> |
| 126 | + struct VS<T1, T2, T3> { |
| 127 | + template<class U> |
| 128 | + friend class C<T1>::Nested, class C<T2>::Nested, class C<T3>::Nested; |
| 129 | + }; |
| 130 | +</PRE> |
| 131 | + |
| 132 | +<P>However, that violates the principle that |
| 133 | +a <I>template-declaration</I> declares exactly one entity |
| 134 | +(see <A HREF="2862.html">issue 2862</A>).</P> |
| 135 | + |
| 136 | +<P>As an aside, the paper as adopted misrepresents the status of |
| 137 | +members of dependent types, which are covered by |
| 138 | +13.7.5 [<A href="https://wg21.link/temp.friend#5">temp.friend</A>] paragraph 5.</P> |
| 139 | + |
| 140 | +<P>CWG welcomes a paper making the template friend cases valid, but |
| 141 | +such a facility would appear to require substantial changes to the |
| 142 | +normative wording, which a core issue is not equipped for.</P> |
| 143 | + |
| 144 | +<P>CWG asks EWG to consent to the reduction in scope for the variadic |
| 145 | +friends facility.</P> |
| 146 | + |
103 | 147 | <BR><BR>
|
104 | 148 | </BODY>
|
105 | 149 | </HTML>
|
0 commit comments