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.
Showing
- gcc/cp/pt.c 3 additions, 0 deletionsgcc/cp/pt.c
- gcc/testsuite/g++.dg/cpp1z/class-deduction-access1.C 18 additions, 0 deletionsgcc/testsuite/g++.dg/cpp1z/class-deduction-access1.C
- gcc/testsuite/g++.dg/cpp1z/class-deduction-access2.C 10 additions, 0 deletionsgcc/testsuite/g++.dg/cpp1z/class-deduction-access2.C
Loading
Please register or sign in to comment