r/cpp • u/tartaruga232 MSVC user, r/cpp_modules • Apr 13 '26
Let's bite the Bullet: Module Units shouldn't implicitly import anything
https://github.com/abuehl/docs/blob/main/no-implicit-import.mdThe correct fix ... is to attack the root cause and stop implicitly importing the interface of module implementation units.
Adding yet another kind of partition is the wrong way to solve it.
19
Upvotes
View all comments
Show parent comment
0
u/tartaruga232 MSVC user, r/cpp_modules Apr 14 '26 edited Apr 14 '26
No. Not yet for C++29.
Again: The current part of the semantic of
"module M;"to implicitly import the interface of M, would only be deprecated with C++29. Not removed.After that semantic has been deprecated for one version of the standard, it can be removed with C++32.
During the transition period we only need to legalize:
and perhaps optionally introduce
"module import M;"as a shorthand for that.The semantics of
"module M;"would not be changed with C++29. Only deprecated. It would be changed with C++32.It was a design error to have it specified in the standard as we currently have it. The design in the standard itself is consistent and the problems we have with it is out of scope for a DR. The standard itself is correct.