Title
Importing header units synthesized from source files
Status
open
Section
10.3 [module.import]
Submitter
Jim X

Created on 2023-05-04.00:00:00 last changed 19 months ago

Messages

Date: 2023-05-04.00:00:00

Subclause 10.3 [module.import] paragraph 5 specifies:

A module-import-declaration that specifies a header-name H imports a synthesized header unit, which is a translation unit formed by applying phases 1 to 7 of translation (5.2 [lex.phases]) to the source file or header nominated by H, which shall not contain a module-declaration. ... An importable header is a member of an implementation-defined set of headers that includes all importable C++ library headers (16.4.2.3 [headers]). H shall identify an importable header. ...

This text seems to recognize that header units may be synthesized from non-headers (i.e. source files), yet a module-import-declaration of the form import header-name is required to name an (importable) header, not an arbitrary source file turned into header unit.

Possible resolution:

Change in 10.3 [module.import] paragraph 5 as follows:

H shall identify an importable header. If H nominates a header, that header shall be an importable header.
History
Date User Action Args
2023-05-04 00:00:00admincreate