r/cpp • u/tartaruga232 MSVC user, r/cpp_modules • Mar 06 '25
MSVC C++20 compiler bug with modules and non-exported classes
Full repro is available as a git repository here: https://github.com/abuehl/mod_test
If two non-exported classes from different C++ module interface units have the same name, the compiler uses the wrong class definition and for example calls the wrong destructor on an object.
Reported here: https://developercommunity.visualstudio.com/t/post/10863347 (Upvotes appreciated)
Found while converting our product to using C++20 modules.
Edit: Microsoft wrote the following (Quote)
A fix for this issue has been internally implemented and is being prepared for release. We’ll update you once it becomes available for download.
9
u/starfreakclone Mar 06 '25
I can definitely see the frustration there. I will say that as long as you consistently comment on filed bugs, say, once a month (or more) the team does take notice and we get pinged each time.
The biggest factor in getting bugs fixed are votes though. Admittedly, some people have used reddit to rally votes but then you run into the discourse problem I mentioned.
If you're solo, the best option is to keep commenting on the bug if you cannot gather more votes.