aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorNathaniel Shead <nathanieloshead@gmail.com>2024-04-09 21:52:38 +1000
committerNathaniel Shead <nathanieloshead@gmail.com>2024-05-01 15:59:14 +1000
commit3032ebf0c9b769f02f494e97417a1b68ad59c884 (patch)
tree85f472ac66ba668db315df5fec7c829d9ec4c2fc /gcc/cp
parent0d0215b10dbbe39d655ceda4af283f288ec7680c (diff)
downloadgcc-3032ebf0c9b769f02f494e97417a1b68ad59c884.zip
gcc-3032ebf0c9b769f02f494e97417a1b68ad59c884.tar.gz
gcc-3032ebf0c9b769f02f494e97417a1b68ad59c884.tar.bz2
c++: Propagate hidden flag on decls from partitions
While working on some other fixes I noticed that the partition handling code used the wrong flag to propagate OVL_HIDDEN_P on exported bindings from partitions. This patch fixes that, and renames the flag to be clearer. gcc/cp/ChangeLog: * name-lookup.cc (walk_module_binding): Use the partition-specific hidden flag instead of the top-level decl_hidden. gcc/testsuite/ChangeLog: * g++.dg/modules/using-16_a.C: New test. * g++.dg/modules/using-16_b.C: New test. * g++.dg/modules/using-16_c.C: New test. Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/name-lookup.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/cp/name-lookup.cc b/gcc/cp/name-lookup.cc
index 5d2319d..78f08ac 100644
--- a/gcc/cp/name-lookup.cc
+++ b/gcc/cp/name-lookup.cc
@@ -4290,19 +4290,19 @@ walk_module_binding (tree binding, bitmap partitions,
count += callback (btype, flags, data);
}
- bool hidden = STAT_DECL_HIDDEN_P (bind);
+ bool part_hidden = STAT_DECL_HIDDEN_P (bind);
for (ovl_iterator iter (MAYBE_STAT_DECL (STAT_DECL (bind)));
iter; ++iter)
{
if (iter.hidden_p ())
- hidden = true;
+ part_hidden = true;
gcc_checking_assert
- (!(hidden && DECL_IS_UNDECLARED_BUILTIN (*iter)));
+ (!(part_hidden && DECL_IS_UNDECLARED_BUILTIN (*iter)));
WMB_Flags flags = WMB_None;
if (maybe_dups)
flags = WMB_Flags (flags | WMB_Dups);
- if (decl_hidden)
+ if (part_hidden)
flags = WMB_Flags (flags | WMB_Hidden);
if (iter.using_p ())
{
@@ -4311,7 +4311,7 @@ walk_module_binding (tree binding, bitmap partitions,
flags = WMB_Flags (flags | WMB_Export);
}
count += callback (*iter, flags, data);
- hidden = false;
+ part_hidden = false;
}
}
}