-
Notifications
You must be signed in to change notification settings - Fork 4
Description
The semantics of the private module fragment (PMF) are underspecified. It appears well formed to declare an entity in the interface purview and define it in the PMF. How does this interact with inlining, instantiation and internal linkage definitions? The intent of the PMF is as-if it is a separate module implementation unit, but we do not define the boundary between the interface purview and the PMF as a translation unit boundary. Implementations may defer instantiation (of function definitions) to the end of translation. Similarly internal linkage and inline functions (that are ODR-used) must be defined at the end of translation. Perhaps emission of Compiled Module Interface (CMI) should be deferred to the end of translation – and not at the beginning of the PMF. It will therefore observe entities declared or defined in the PMF. This may create implementation difficulty to preserve the semantics of the PMF being as-if a separate translation unit. Alternatively, the boundary could be specified as a new kind of ‘end of translation’ point. This seems a dramatic change.
Proposed change:
Remove the private module fragment. It’s semantics are too ill-defined, and I do not believe there is sufficient experience to define them at this point.