[Bug c++/85790] c++17 - Access control issue with template argument deduction
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Aug 2 09:24:15 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85790
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Fixed by r12-926
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.
More information about the Gcc-bugs
mailing list