1. The Problem
After implementing part of [P1857R3], Clang soon discovered that it makes the following code ill-formed:
#line 1 "A.cppm" export module a ;
This is a problem because tools such as build2, ccache,
and distcc, among many others, rely on feeding the preprocessed output back into the
compiler. This output generally contains
(or GNU line marker) directives at the start of the file.
2. The Fix
The standard should allow
directives to appear on any line.
3. Wording
Modify [cpp.pre]:
module-file: groupopt pp-global-module-fragmentopt pp-module groupopt pp-private-module-fragmentopt
4 At the start of phase 4 of translation, the group of a pp-global-module-fragment shall contain neither a text-line nor a pp-import.
5 At the start of phase 4 of translation, the leading group of a module-file, if present, shall consist only ofdirectives.
#line