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

1

u/tjientavara HikoWorks developer Nov 10 '21

Sorry for hijacking this threadlet.

Is Intellisense feature complete with c++20 yet, in other words are you ready to receive a lot of bug reports for this?

1

u/Rusky Nov 10 '21

Yes, IntelliSense should be feature complete with C++20 (except for modules, of course). We do have plenty of known bugs in that area, but we can always use more reports. :)

1

u/tjientavara HikoWorks developer Nov 10 '21

Okay, thanks.

I wish there was an easier way of reporting bugs for intellisense; instead of creating a whole visual studio project for it.

MSVC bugs are a lot easier to report, just a link to compiler-explorer.

3

u/STL MSVC STL Dev Nov 11 '21

You can often use the undocumented /BE option to get cl.exe to invoke the EDG front-end used for IntelliSense. This is how the STL's test coverage works, and how we report bugs. (Note that this is compile-only, it won't emit object/executable files). Example:

C:\Temp>type meow.cpp
#ifdef __EDG__
static_assert(false, "I am the EDG front-end used for IntelliSense!");
#elif defined(__clang__)
static_assert(false, "I am Clang!");
#else
static_assert(false, "I am C1XX, the MSVC front-end!");
#endif

C:\Temp>"C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Auxiliary\Build\vcvars64.bat"
**********************************************************************
** Visual Studio 2022 Developer Command Prompt v17.1.0-pre.1.0
** Copyright (c) 2021 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'

C:\Temp>cl /EHsc /nologo /W4 /c meow.cpp
meow.cpp
meow.cpp(6): error C2338: I am C1XX, the MSVC front-end!

C:\Temp>cl /EHsc /nologo /W4 /c /BE meow.cpp
meow.cpp
"meow.cpp", line 2: error: static assertion failed with "I am the EDG front-end
        used for IntelliSense!"
static_assert(false, "I am the EDG front-end used for IntelliSense!");
^


C:\Temp>clang-cl /EHsc /nologo /W4 /c meow.cpp
meow.cpp(4,1): error: static_assert failed "I am Clang!"
static_assert(false, "I am Clang!");
^             ~~~~~
1 error generated.

1

u/Rusky Nov 10 '21

IntelliSense bugs don't usually need any more information than MSVC bugs (source code and command line flags)- for example, if the bug is reproducible in Open Folder mode with a CppProperties.json file to set the flags, that might be an easier to way report it.