gcc/libstdc++-v3/testsuite/23_containers/set
Patrick Palka 7da4eae3dc c++: excessive instantiation during CTAD [PR101174]
We set DECL_CONTEXT on implicitly generated deduction guides so that
their access is consistent with that of the constructor.  But this
apparently leads to excessive instantiation in some cases, ultimately
because instantiation of a deduction guide should be independent of
instantiation of the resulting class specialization, but setting the
DECL_CONTEXT of the former to the latter breaks this independence.

To fix this, this patch makes push_access_scope handle artificial
deduction guides specifically rather than setting their DECL_CONTEXT
in build_deduction_guide.  We could alternatively make the class
befriend the guide via DECL_BEFRIENDING_CLASSES, but that wouldn't
be a complete fix and would break class-deduction-access3.C below
since friendship isn't transitive.

	PR c++/101174

gcc/cp/ChangeLog:

	* pt.c (push_access_scope): For artificial deduction guides,
	set the access scope to that of the constructor.
	(pop_access_scope): Likewise.
	(build_deduction_guide): Don't set DECL_CONTEXT on the guide.

libstdc++-v3/ChangeLog:

	* testsuite/23_containers/multiset/cons/deduction.cc:
	Uncomment CTAD example that was rejected by this bug.
	* testsuite/23_containers/set/cons/deduction.cc: Likewise.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp1z/class-deduction-access3.C: New test.
	* g++.dg/cpp1z/class-deduction91.C: New test.
2021-06-23 17:23:39 -04:00
..
allocator c++: value-init vs zero-init in expand_aggr_init_1 [PR65816] 2021-06-01 16:21:10 -04:00
capacity Update copyright years. 2021-01-04 10:26:59 +01:00
cons c++: excessive instantiation during CTAD [PR101174] 2021-06-23 17:23:39 -04:00
debug Update copyright years. 2021-01-04 10:26:59 +01:00
modifiers libstdc++: Remove redundant -std=gnu++17 option from containers tests 2021-05-10 16:22:53 +01:00
operations Update copyright years. 2021-01-04 10:26:59 +01:00
operators Update copyright years. 2021-01-04 10:26:59 +01:00
requirements Update copyright years. 2021-01-04 10:26:59 +01:00
14340.cc Update copyright years. 2021-01-04 10:26:59 +01:00
18604.cc Update copyright years. 2021-01-04 10:26:59 +01:00
23781_neg.cc Update copyright years. 2021-01-04 10:26:59 +01:00
48101_neg.cc Update copyright years. 2021-01-04 10:26:59 +01:00
48101-2_neg.cc Update copyright years. 2021-01-04 10:26:59 +01:00
48101-3_neg.cc Update copyright years. 2021-01-04 10:26:59 +01:00
58764.cc Update copyright years. 2021-01-04 10:26:59 +01:00
85965.cc Update copyright years. 2021-01-04 10:26:59 +01:00
92124.cc Update copyright years. 2021-01-04 10:26:59 +01:00
check_construct_destroy.cc Update copyright years. 2021-01-04 10:26:59 +01:00
erasure.cc Update copyright years. 2021-01-04 10:26:59 +01:00
init-list.cc Update copyright years. 2021-01-04 10:26:59 +01:00
move_comparison.cc Update copyright years. 2021-01-04 10:26:59 +01:00
pmr_typedefs_debug.cc libstdc++: Remove redundant -std=gnu++17 option from PMR tests 2021-05-10 16:22:53 +01:00
pmr_typedefs.cc libstdc++: Remove redundant -std=gnu++17 option from PMR tests 2021-05-10 16:22:53 +01:00
range_access.cc Update copyright years. 2021-01-04 10:26:59 +01:00