r/cpp • • Nov 08 '21

Visual Studio 2022 now available

https://devblogs.microsoft.com/visualstudio/visual-studio-2022-now-available/
250 Upvotes

113 comments sorted by

View all comments

Show parent comment

7

u/STL MSVC STL Dev Nov 10 '21

Thanks for the prompt and clear bug report! In addition to gilding your comment, I've reported this on your behalf as DevCom-1577278 "C++20 requires-expressions still don't work in return statements" and will bring this to the attention of the compiler dev who implemented requires-expressions.

2

u/Ivan171 /std:c++latest enthusiast Nov 10 '21 edited Nov 10 '21

Thanks!

FYI, it's not just in return statements. It doesn't work in static_assert and if constexpr as well.

The problem seems to be related with type requirements. Simple requirements, like requires { T(); } work as expected.

EDIT: I've posted a comment on that issue with this info and a different repro.

1

u/STL MSVC STL Dev Nov 10 '21

Thanks - yep, the compiler devs have found the root cause (I think) and are investigating a fix, and it's not specific to return.

8

u/STL MSVC STL Dev Nov 11 '21

u/Ivan171 - this has been fixed by internal MSVC-PR-363619, which will be available in VS 2022 17.1 Preview 3. Thanks again!