[modules] Preprocessing requires compiled header unit modules
Ben Boeckel
ben.boeckel@kitware.com
Thu Apr 21 12:05:33 GMT 2022
On Thu, Apr 21, 2022 at 06:05:52 +0200, Boris Kolpackov wrote:
> I don't think it is. A header unit (unlike a named module) may export
> macros which could affect further dependencies. Consider:
>
> import "header-unit.hpp"; // May or may not export macro FOO.
>
> #ifdef FOO
> import "header-unit2.hpp"
> #endif
I agree that the header needs to be *found*, but scanning cannot require
a pre-existing BMI for that header. A new mode likely needs to be laid
down to get the information necessary (instead of just piggy-backing on
`-E` behavior to get what I want).
--Ben
More information about the Gcc
mailing list