This is an archive of the discontinued LLVM Phabricator instance.

Fix merging of member-like constrained friends across modules.
ClosedPublic

Authored by rsmith on Mar 28 2023, 10:59 AM.

Details

Summary

When a friend declaration has a requires-clause, and either it's a
non-template function or it's a function template whose requires-clause
depends on an enclosing template parameter, it is member-like for the
purpose of redeclaration checking. Specifically, the lexically enclosing
class becomes part of its signature, so it can only be redeclared by
another declaration within the same class.

Previously we supported this rule when parsing declarations, but not
when merging them across modules.

Diff Detail

Event Timeline

rsmith created this revision.Mar 28 2023, 10:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 28 2023, 10:59 AM
rsmith requested review of this revision.Mar 28 2023, 10:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 28 2023, 10:59 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
rsmith updated this revision to Diff 509818.Mar 30 2023, 2:26 PM
  • Merge branch 'main' into merge-constrained-friends

Hm, looks like rGdb1b827ecfed6 landed the actual functioal change here, making this just a no-functional-change refactoring plus an added test, so I'm going to go ahead and land it.

Hm, looks like rGdb1b827ecfed6 landed the actual functioal change here, making this just a no-functional-change refactoring plus an added test, so I'm going to go ahead and land it.

Makes sense to me, thanks!

erichkeane accepted this revision.Mar 30 2023, 3:59 PM
This revision is now accepted and ready to land.Mar 30 2023, 3:59 PM