On 8/7/24 7:22 PM, Nathaniel Shead wrote:
On Wed, Aug 07, 2024 at 04:18:47PM -0400, Jason Merrill wrote:
On 8/5/24 9:16 AM, Nathaniel Shead wrote:
Bootstrapped and regtested (so far just modules.exp) on
x86_64-pc-linux-gnu, OK for trunk if full regtest passes?
OK.
@@ -11316,6 +11319,7 @@ trees_in::key_mergeable (int tag, merge_kind mk, tree
decl, tree inner,
case NAMESPACE_DECL:
if (is_attached
+ && !is_imported_temploid_friend
How can a namespace be an imported temploid friend?
Cut off by context, but this is
switch (TREE_CODE (container))
{
default:
gcc_unreachable ();
case NAMESPACE_DECL:
if (is_attached
&& !is_imported_temploid_friend
&& !(state->is_module () || state->is_partition ()))
kind = "unique";
i.e. the NAMESPACE_DECL is referring to the container that the decl is
attached to for merging purposes.
Oops, yes, I figured that out but forgot to delete that comment. :)
&& !(state->is_module () || state->is_partition ()))
kind = "unique";
else
@@ -11347,7 +11351,9 @@ trees_in::key_mergeable (int tag, merge_kind mk, tree
decl, tree inner,
break;
case TYPE_DECL:
- if (is_attached && !(state->is_module () || state->is_partition ())
+ if (is_attached
+ && !is_imported_temploid_friend
This is the one that may perhaps be unnecessary (on thinking over this
again I would expect any class-scope friends to not be redeclared
outside of their named module, even for imported templates?), so I'll
actually re-test this patch without this hunk.
Sounds good.
Jason