diff options
author | Simon Martin <simon@nasilyan.com> | 2024-09-10 22:33:18 +0200 |
---|---|---|
committer | Simon Martin <simon@nasilyan.com> | 2024-09-12 10:15:23 +0200 |
commit | 19831baf4904d09a74c7cf684a27b091947a610b (patch) | |
tree | c31895955748f3f6356e12c816f14c6cc34fced3 /libcpp/files.cc | |
parent | f9e9ba9563c81ca2db99bf3daa6511c1471f1b78 (diff) | |
download | gcc-19831baf4904d09a74c7cf684a27b091947a610b.zip gcc-19831baf4904d09a74c7cf684a27b091947a610b.tar.gz gcc-19831baf4904d09a74c7cf684a27b091947a610b.tar.bz2 |
c++: Don't ICE to build private access error message [PR116323]
We currently ICE upon the following code while building the "[...] is
private within this context" error message
=== cut here ===
class A { enum Enum{}; };
template<typename E, template<typename> class Alloc>
class B : private Alloc<E>, private A {};
template<typename E, template<typename> class Alloc>
int B<E, Alloc>::foo (Enum m) { return 42; }
=== cut here ===
The problem is that since r11-6880, after detecting that Enum cannot be
accessed in B, enforce_access will access the TYPE_BINFO of all the
bases of B, which ICEs for any that is a BOUND_TEMPLATE_TEMPLATE_PARM.
This patch simply skips such bases.
PR c++/116323
gcc/cp/ChangeLog:
* search.cc (get_parent_with_private_access): Only call access_in_type
for RECORD_OR_UNION_TYPE_P base BINFOs.
gcc/testsuite/ChangeLog:
* g++.dg/template/access43.C: New test.
Diffstat (limited to 'libcpp/files.cc')
0 files changed, 0 insertions, 0 deletions