ut icon indicating copy to clipboard operation
ut copied to clipboard

Using `#include` in purview of a named module

Open Benio101 opened this issue 4 years ago • 0 comments

Replacing #include preprocessing directives with import directive for importable C++ library headers is implementation‐defined.

If the header identified by the header-name denotes an importable header ([module.import]), it is implementation-defined whether the #include preprocessing directive is instead replaced by an import directive ([cpp.import]) of the form import header-name ; new-line

[cpp.include]/7

https://github.com/boost-ext/ut/blob/c3ed7a21a18a4de3fc807451ae86c9f51e706a11/include/boost/ut.hpp#L55

Using #include in purview of a named module yields C5244 in MSVC 2022 (19.30.30528).

'#include ' in the purview of module 'module-name-1' appears erroneous. Consider moving that directive before the module declaration, or replace the textual inclusion with 'import ;'.

Benio101 avatar Oct 11 '21 14:10 Benio101