diff options
author | Vlad Serebrennikov <serebrennikov.vladislav@gmail.com> | 2024-06-04 17:42:26 +0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-04 17:42:26 +0400 |
commit | e651ee98cfcdebd799de0d61eca22b7b1493cc96 (patch) | |
tree | eff2919d8a436be74fd3e974ceed4af055ad2fad /clang/www | |
parent | 90049bbbeae3da553e43a015a2e7d7e355c0a0ce (diff) | |
download | llvm-e651ee98cfcdebd799de0d61eca22b7b1493cc96.zip llvm-e651ee98cfcdebd799de0d61eca22b7b1493cc96.tar.gz llvm-e651ee98cfcdebd799de0d61eca22b7b1493cc96.tar.bz2 |
[clang] Add tests for Core issues about friend templates (#94288)
This patch covers the following Core issues:
[CWG1862](https://cplusplus.github.io/CWG/issues/1862.html) "Determining
“corresponding members” for friendship"
[CWG1918](https://cplusplus.github.io/CWG/issues/1918.html) "`friend`
templates with dependent scopes"
[CWG1945](https://cplusplus.github.io/CWG/issues/1945.html) "Friend
declarations naming members of class templates in non-templates"
All of them were resolved by CWG1862, where the current wording of
[[temp.friend] p5](https://eel.is/c++draft/temp.friend#5) comes from:
> A template friend declaration may declare a member of a dependent type
to be a friend[.](https://eel.is/c++draft/temp.friend#5.sentence-1) The
friend declaration shall declare a function or specify a type with an
[elaborated-type-specifier](https://eel.is/c++draft/dcl.type.elab#nt:elaborated-type-specifier),
in either case with a
[nested-name-specifier](https://eel.is/c++draft/expr.prim.id.qual#nt:nested-name-specifier)
ending with a
[simple-template-id](https://eel.is/c++draft/temp.names#nt:simple-template-id),
C, whose
[template-name](https://eel.is/c++draft/temp.names#nt:template-name)
names a class
template[.](https://eel.is/c++draft/temp.friend#5.sentence-2) The
template parameters of the template friend declaration shall be
deducible from C
([[temp.deduct.type]](https://eel.is/c++draft/temp.deduct.type))[.](https://eel.is/c++draft/temp.friend#5.sentence-3)
In this case, a member of a specialization S of the class template is a
friend of the class granting friendship if deduction of the template
parameters of C from S succeeds, and substituting the deduced template
arguments into the friend declaration produces a declaration that
corresponds to the member of the
specialization[.](https://eel.is/c++draft/temp.friend#5.sentence-4)
A useful example is provided after the paragraph:
https://eel.is/c++draft/temp.friend#example-4.
Neither of Core issues is implemented, because we don't support
dependent nested friend specifiers.
---------
Co-authored-by: Shafik Yaghmour <shafik.yaghmour@intel.com>
Diffstat (limited to 'clang/www')
-rwxr-xr-x | clang/www/cxx_dr_status.html | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html index 4d94ac5..e5f7941 100755 --- a/clang/www/cxx_dr_status.html +++ b/clang/www/cxx_dr_status.html @@ -10980,7 +10980,7 @@ and <I>POD class</I></td> <td><a href="https://cplusplus.github.io/CWG/issues/1862.html">1862</a></td> <td>CD5</td> <td>Determining “corresponding members” for friendship</td> - <td class="unknown" align="center">Unknown</td> + <td class="none" align="center">No</td> </tr> <tr id="1863"> <td><a href="https://cplusplus.github.io/CWG/issues/1863.html">1863</a></td> @@ -11316,7 +11316,7 @@ and <I>POD class</I></td> <td><a href="https://cplusplus.github.io/CWG/issues/1918.html">1918</a></td> <td>CD5</td> <td><TT>friend</TT> templates with dependent scopes</td> - <td class="unknown" align="center">Unknown</td> + <td class="none" align="center">No</td> </tr> <tr class="open" id="1919"> <td><a href="https://cplusplus.github.io/CWG/issues/1919.html">1919</a></td> @@ -11478,7 +11478,7 @@ and <I>POD class</I></td> <td><a href="https://cplusplus.github.io/CWG/issues/1945.html">1945</a></td> <td>CD5</td> <td>Friend declarations naming members of class templates in non-templates</td> - <td class="unknown" align="center">Unknown</td> + <td class="none" align="center">No</td> </tr> <tr id="1946"> <td><a href="https://cplusplus.github.io/CWG/issues/1946.html">1946</a></td> |