This is an archive of the discontinued LLVM Phabricator instance.

[C++20][Modules] Allow for redeclarations in partitions.
ClosedPublic

Authored by iains on Jun 13 2022, 2:47 AM.

Details

Summary

The existing provision is not sufficient, it did not allow for the cases
where an implementation partition includes the primary module interface,
or for the case that an exported interface partition is contains a decl
that is then implemented in a regular implementation unit.

It is somewhat unfortunate that we have to compare top level module names
to achieve this, since built modules are not necessarily available.

TODO: It might be useful to cache a hash of the primary module name if
this test proves to be a significant load.

Diff Detail

Event Timeline

iains created this revision.Jun 13 2022, 2:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 13 2022, 2:47 AM
iains published this revision for review.Jun 13 2022, 2:48 AM
iains added reviewers: urnathan, ChuanqiXu.

this is really a bug fix, rather than a new feature - the current impl was not general enough.

Herald added a project: Restricted Project. · View Herald TranscriptJun 13 2022, 2:49 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
ChuanqiXu accepted this revision.Jun 13 2022, 11:08 PM

LGTM. Yeah, it might be painful to compare string all the time. Let's do it when refactoring.

This revision is now accepted and ready to land.Jun 13 2022, 11:08 PM
This revision was landed with ongoing or failed builds.Jul 8 2022, 11:03 AM
This revision was automatically updated to reflect the committed changes.