mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-22 15:00:55 +08:00
c++: Fix unhiding friend with imports [PR 99248]
This was a simple thinko about which object held the reference to the binding vector. I also noticed stale code in the tree dumper, as I recently removed the flags from a lazy number. PR c++/99248 gcc/cp/ * name-lookup.c (lookup_elaborated_type_1): Access slot not bind when there's a binding vector. * ptree.c (cxx_print_xnode): Lazy flags are no longer a thing. gcc/testsuite/ * g++.dg/modules/pr99248.h: New. * g++.dg/modules/pr99248_a.H: New. * g++.dg/modules/pr99248_b.H: New.
This commit is contained in:
parent
5643f6f396
commit
5f27a9f90d
@ -7940,7 +7940,7 @@ lookup_elaborated_type_1 (tree name, TAG_how how)
|
||||
if (*slot == bind)
|
||||
*slot = decl;
|
||||
else
|
||||
BINDING_VECTOR_CLUSTER (bind, 0)
|
||||
BINDING_VECTOR_CLUSTER (*slot, 0)
|
||||
.slots[BINDING_SLOT_CURRENT] = decl;
|
||||
}
|
||||
}
|
||||
|
@ -310,8 +310,7 @@ cxx_print_xnode (FILE *file, tree node, int indent)
|
||||
{
|
||||
indent_to (file, indent + 4);
|
||||
unsigned lazy = slot.get_lazy ();
|
||||
fprintf (file, "%s snum:%u flags:%d",
|
||||
pfx, lazy >> 2, lazy & 3);
|
||||
fprintf (file, "%s snum:%u", pfx, lazy);
|
||||
}
|
||||
else if (slot)
|
||||
print_node (file, pfx, slot, indent + 4);
|
||||
|
5
gcc/testsuite/g++.dg/modules/pr99248.h
Normal file
5
gcc/testsuite/g++.dg/modules/pr99248.h
Normal file
@ -0,0 +1,5 @@
|
||||
class locale
|
||||
{
|
||||
template<typename _Cache>
|
||||
friend struct __use_cache;
|
||||
};
|
5
gcc/testsuite/g++.dg/modules/pr99248_a.H
Normal file
5
gcc/testsuite/g++.dg/modules/pr99248_a.H
Normal file
@ -0,0 +1,5 @@
|
||||
// PR 99248 ICE with friend
|
||||
// { dg-additional-options -fmodule-header }
|
||||
// { dg-module-cmi {} }
|
||||
#include "pr99248.h"
|
||||
|
7
gcc/testsuite/g++.dg/modules/pr99248_b.H
Normal file
7
gcc/testsuite/g++.dg/modules/pr99248_b.H
Normal file
@ -0,0 +1,7 @@
|
||||
// { dg-additional-options -fmodule-header }
|
||||
// { dg-module-cmi {} }
|
||||
#include "pr99248.h"
|
||||
import "pr99248_a.H";
|
||||
|
||||
template<typename _Facet>
|
||||
struct __use_cache;
|
Loading…
x
Reference in New Issue
Block a user