[all-commits] [llvm/llvm-project] e651ee: [clang] Add tests for Core issues about friend tem...
Vlad Serebrennikov via All-commits
all-commits at lists.llvm.org
Tue Jun 4 06:42:48 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: e651ee98cfcdebd799de0d61eca22b7b1493cc96
https://github.com/llvm/llvm-project/commit/e651ee98cfcdebd799de0d61eca22b7b1493cc96
Author: Vlad Serebrennikov <serebrennikov.vladislav at gmail.com>
Date: 2024-06-04 (Tue, 04 Jun 2024)
Changed paths:
M clang/test/CXX/drs/cwg18xx.cpp
M clang/test/CXX/drs/cwg19xx.cpp
M clang/www/cxx_dr_status.html
Log Message:
-----------
[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 at intel.com>
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list