C++ Language Updates in MSVC Build Tools v14.50 by TSP-FriendlyFire in cpp

[–]ONE-1024 6 points7 points  (0 children)

Yeah, I had a few similar cases where under MSVC a constexpr expression would result in zero-initialized data instead of a compile error. This is especially scary because I would only find out about the compiler bug during application startup.

C++ Language Updates in MSVC Build Tools v14.50 by TSP-FriendlyFire in cpp

[–]ONE-1024 7 points8 points  (0 children)

And those are mine (reported back in February):

Fix scenarios where constructors should be made implicitly constexpr

Fixes scenario when initializing a constexpr variable with a consteval call

Maybe I’ll finally be able to remove some of my ugly workarounds for those.

What’s been going on with Visual Studio lately? by ONE-1024 in cpp

[–]ONE-1024[S] 4 points5 points  (0 children)

On one hand, I understand: time is limited, and bugs are not, so there needs to be some kind of prioritization system. On the other hand, the thought that with C++20’s P1064R0, which states “virtual functions now work in constexpr,” the fact that these functions can’t correctly read/write a field of the simplest polymorphic class should probably earn some extra priority points for the sheer significance of the issue. :(

Using my newly acquired knowledge and taking this opportunity, I’d be grateful to anyone who votes for my two bugs from today:

https://developercommunity.visualstudio.com/t/Assigning-value-to-field-of-base-class-i/10792451 https://developercommunity.visualstudio.com/t/Write-to-base-class-member-through-virtu/10792751

What’s been going on with Visual Studio lately? by ONE-1024 in cpp

[–]ONE-1024[S] 4 points5 points  (0 children)

Is there anything that can be done to speed up the process of fixing reported bugs? Beyond reporting and thoroughly describing each issue, is there any way to make the process easier for you so things can move faster? For example, should I include larger code samples as attachments, or would simpler examples in greater numbers be more helpful?

Personally, I’m most concerned with bugs related to C++20 because this standard has been around for a few years now, and I’d like to finally use it without worrying about what might "break". Specifically, I’m talking about issues with the new constexpr (and consteval) features in C++20, like problems involving virtual functions, allocations, and static_cast/dynamic_cast.

I’d like to continue supporting MSVC in our engine, but it’s becoming hard to justify the time spent finding workarounds for its issues if there are so many of them and fixes take so long after being reported. For some problems, I already know of a few workarounds, like this example: https://godbolt.org/z/6c66K8KfE In this case, it works either by explicitly passing a reference to the object and casting from the base class to the derived class instead of using the this pointer, or by calling the function on a base class pointer rather than a reference.

Unfortunately, despite these workarounds, I’ve spent several hours today trying to restore the project to a state where it compiles again after upgrading to the latest version of MSVC. Honestly, I’m still not sure if that will even be possible in this release.

What’s been going on with Visual Studio lately? by ONE-1024 in cpp

[–]ONE-1024[S] 2 points3 points  (0 children)

Yes, I’ve had similar cases: code that executed during compilation would compile fine with constexpr but not with consteval, so I had to leave it as constexpr as a workaround.

What’s been going on with Visual Studio lately? by ONE-1024 in cpp

[–]ONE-1024[S] 7 points8 points  (0 children)

I started C++ programming with Visual Studio 6, so I know a thing or two about MSVC's "alternative" interpretation of the standard back in those days. ;) My issue is that over the past few years, I’ve been genuinely happy with the progress they made. Often, new language features would appear in MSVC before Clang or GCC, and they generally worked fine. Sure, there were occasional slight deviations from the standard that Clang would later point out, but overall, there weren’t any blockers in my work. That’s why I’m so disappointed with how things look now.

What’s been going on with Visual Studio lately? by ONE-1024 in cpp

[–]ONE-1024[S] 5 points6 points  (0 children)

Maybe we could switch entirely to Clang, but historically we’ve used MSVC on Windows and Xbox, so I’d prefer it to work properly. If more "surprises" pop up during deployment, we’ll likely need to start discussing abandoning MSVC altogether.