On Tuesday, March 25, 2014, Stack Machine <
stackm...@hotmail.com> wrote:
In current C++, the preprocessor can be run independently of the actual compilation step.
[You are referring to a "preprocess-only" mode, wherein a translator performs translation phases 1 through 4 only. ]
True so far...
If macros can be imported, this is no longer true.
If macros can be imported, that implies a possible future change to phase 4 that you have not yet taken into account.
There is little doubt as to whether it is possible to modify [lex.phases] in such a way that we get this effect. (It can be done.)
There is little doubt as to whether it is possible to implement. (It can be done.)
There IS an open question as to whether it's *desired* because of concerns about migration paths. However, there is also good reason to think that those concerns can be addressed without "import A;" causing an execution during phase 4.
We already have the tool in place to import macros, it's called "#include".
Personally, I agree, and I think we can produce wording that agrees with this sentiment, while simultaneously indicating (outside of the International Standard) a migration path where #include <foo.h> has the effect of an import directive followed by the execution of a subset of phase 4 directives that would normally result from traditonal preprocessing.
Implementors have not yet found issue with this approach to migration, and so it seems viable at this time.
Consequently, I do not currently foresee objection to any modules proposal where the import directive has no effect during phase 4.