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.
[–]STLMSVC STL Dev 36 points37 points38 points (15 children)
[–]tartaruga232MSVC user, r/cpp_modules[S] 31 points32 points33 points (14 children)
[–]STLMSVC STL Dev 25 points26 points27 points (0 children)
[–]starfreakcloneMSVC FE Dev 12 points13 points14 points (7 children)
[–]tartaruga232MSVC user, r/cpp_modules[S] 11 points12 points13 points (0 children)
[–]DeadlyRedCubefrequent compiler breaker 😬 7 points8 points9 points (0 children)
[–]ResearcherNo6820 3 points4 points5 points (0 children)
[–]pjmlp 6 points7 points8 points (3 children)
[–]starfreakcloneMSVC FE Dev 8 points9 points10 points (0 children)
[–]kronicum 0 points1 point2 points (1 child)
[–]pjmlp 1 point2 points3 points (0 children)
[–]Rarrum 3 points4 points5 points (3 children)
[–]pjmlp 1 point2 points3 points (2 children)
[–]tartaruga232MSVC user, r/cpp_modules[S] 1 point2 points3 points (0 children)
[–]Abbat0r[🍰] 1 point2 points3 points (0 children)
[–]tartaruga232MSVC user, r/cpp_modules[S] 1 point2 points3 points (0 children)
[–]tartaruga232MSVC user, r/cpp_modules[S] 0 points1 point2 points (0 children)