On Wed, Mar 26, 2025 at 11:40:16PM -0400, Jason Merrill wrote: > On 3/26/25 9:23 AM, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > -- >8 -- > > > > When doing tsubst_friend_class, we need to first check if any imported > > module has already created a (hidden) declaration for the class so that > > we don't end up with conflicting declarations. Currently we do this > > using DECL_MODULE_IMPORT_P, but this is not set in cases where the class > > is in the global module and matches an existing GM declaration we've > > seen (via an include, for example). > > > > This patch fixes this by checking DECL_MODULE_ENTITY_P instead, which is > > set on all entities that have been seen from a module import. We also > > use the 'for_mangle' version of get_originating_module so that we don't > > treat imported GM entities as attached to the module we imported them > > from. > > I had actually made the same change on my branch to get the libstdc++ > testsuite running with modules, I just haven't gotten around to merging it > because I hadn't come up with a reduced testcase. Here's a patch that > merges mine with yours, does it work for you?
Yes, it works for me; thanks.