Commit Graph

2 Commits

Author SHA1 Message Date
Iain Sandoe a29f8dbb7f [C++20][Modules][8/8] Amend module visibility rules for partitions.
Implementation partitions bring two extra cases where we have
visibility of module-private data.

1) When we import a module implementation partition.
2) When a partition implementation imports the primary module intertace.

We maintain a record of direct imports into the current module since
partition decls from direct imports (but not trasitive ones) are visible.

The rules on decl-reachability are much more relaxed (with the standard
giving permission for an implementation to load dependent modules and for
the decls there to be reachable, but not visible).

Differential Revision: https://reviews.llvm.org/D118599
2022-03-01 08:29:05 +00:00
Iain Sandoe 6114491441 [C++20][Modules][4/8] Handle generation of partition implementation CMIs.
Partition implementations are special, they generate a CMI, but it
does not have an 'export' line, and we cannot export anything from the
it [that is it can only make decls available to other members of the
owning module, not to importers of that].

Add initial testcases for partition handling, derived from the examples in
Section 10 of the C++20 standard, which identifies what should be accepted
and/or rejected.

Differential Revision: https://reviews.llvm.org/D118587
2022-02-25 09:33:14 +00:00