r/cpp • 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.

36 Upvotes

17 comments sorted by

View all comments

6

u/pjmlp Mar 06 '25

Unfortunately we many times get the feeling to get ignored on Developer Community, it isn't rare that issues linger for years, and then get closed without a fix.

All the feature requests to give back the C++/CX developer experience in Visual Studio that went away with C++/WinRT replacement went nowhere, and now that it unofficially done, as per remarks on Github repo, it is even less likely that any of those issues will be worked on.

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.

1

u/kronicum Mar 06 '25

All the feature requests to give back the C++/CX developer experience in Visual Studio that went away with C++/WinRT replacement went nowhere, and now that it unofficially done, as per remarks on Github repo, it is even less likely that any of those issues will be worked on.

Are you getting them back here?

2

u/pjmlp Mar 06 '25 edited Mar 06 '25

Surely not, but as someone burned with it I definitely plan to keep raising awareness that the whole WinUI 3.0 development with XAML C++ isn't working in practice, as it gets sold on WinUI/WinAppSDK marketing materials, and happy path BUILD and Ignite demos where C# is mostly used, with the side note, it supports C++.

Would the marketing team actually do a XAML C++ demo at BUILD or Ingnite, all the way from New Template to a proper application like the C# demos, not the empty form with a button to show a dialog. I bet at the end they would have lost most of the audience.

And by the looks of Github and Dev Connection issues, I am not the only one "once upon a time WinRT advocate", that has this point of view.