]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: implicit deduction guides, protected access
authorJason Merrill <jason@redhat.com>
Tue, 18 May 2021 16:16:08 +0000 (12:16 -0400)
committerJason Merrill <jason@redhat.com>
Wed, 19 May 2021 17:29:13 +0000 (13:29 -0400)
commit873c5188fd5d2e17430cab1522aa36fa62582ea7
tree93c18935b80e58880cf781329b94043d85bfb90b
parentadcb497bdba499d161d2e5e8de782bdd6f75d62c
c++: implicit deduction guides, protected access

Jonathan raised this issue with CWG, and there seems to be general agreement
that a deduction guide generated from a constructor should have access to
the same names that the constructor has access to.  That seems to be as easy
as setting DECL_CONTEXT.

gcc/cp/ChangeLog:

* pt.c (build_deduction_guide): Treat the implicit deduction guide
as a member of the class.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1z/class-deduction-access1.C: New test.
* g++.dg/cpp1z/class-deduction-access2.C: New test.
gcc/cp/pt.c
gcc/testsuite/g++.dg/cpp1z/class-deduction-access1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1z/class-deduction-access2.C [new file with mode: 0644]