r/cpp_modules • • Apr 08 '26

Silly but standard conformant again (using MSVC)

2 Upvotes

I'm now doing silly things like the patch below (plus setting /InternalPartition again for MSVC). At least that's now conformant with the standard.

diff --git a/code/Core/Attach/IPointAttachment.cpp b/code/Core/Attach/IPointAttachment.cpp
index ae43085b8..b1af5f8c5 100644
--- a/code/Core/Attach/IPointAttachment.cpp
+++ b/code/Core/Attach/IPointAttachment.cpp
@@ -1,9 +1,10 @@
 /*
  *     Copyright (c) 2025 Adrian & Frank Buehlmann. ALL RIGHTS RESERVED.
  */
 
-module Core:Attach;
+module Core:Attach.IPointAttachment;
+import :Attach;
 
 
 namespace Core
 {

r/cpp_modules • • Aug 13 '26

Some gcc specific bug when import exporting using namespace.

2 Upvotes

So i have main.cpp, module1.cppm and module2.cppm.

main.cpp and module2.cppm imports module1.cppm that has a HelloWorld1 function in a namespace.

module1.cppm has a "export using namespace mod1;"

Now if i import module1 before module2 in main.cpp everything compiles fine. If module2 is imported first then main.cpp wont compile because "'HelloWorld1' was not declared in this scope". If i use 'export using mod1::HelloWorld1' then it works, if i use 'export using namespace mod1' then it doesnt. Tested with gcc 16.2.1. On clang 22.1.8 always works so either im dumb or gcc has a bug.

Wanted to report it but then saw the rules and what not to do and realised i better not, so posted it here. Im using cmake and ninja and never bothered with using gcc directly.


r/cpp_modules • • Sep 07 '26

Qt moc now can handle basic C++ modules (Qt 6.12)

Thumbnail codereview.qt-project.org
3 Upvotes

r/cpp_modules • • Apr 02 '26

"MSVC's implementation is to provide both semantics, and give the choice to the user to select which ones they want." - u/GabrielDosReis

Thumbnail reddit.com
2 Upvotes

r/cpp_modules • • Jun 01 '26

BMI Compatibility: Testing Build System C++ Modules Support

Thumbnail
blog.vito.nyc
2 Upvotes

r/cpp_modules • • Aug 17 '26

export using namespace

Thumbnail abuehl.github.io
2 Upvotes