Introduction
For this update, we have changed things up a little bit. We now have more distinct buckets of fixes/implemented features. This is to help guide readers who care about specific features to more easily see how the compiler front-end team is making progress on the things you care about.
C++23 Features
As part of our continuing ramp-up on C++23 conformance, the team has implemented the following features. In future releases customers can expect to see continued acceleration towards C++23 conformance.
Note: C++23 features can be used by either adding /std:c++latest
or /std:c++23preview
to the command line. In addition, features used from unfinished standards may not have full IntelliSense support.
Adds a new literal suffix which enables a literal to deduce to a form of size_t
.
constexpr auto x = 10zu; // Deduces to 'size_t'
constexpr auto y = 10z; // Deduces to signed form of 'size_t' (i.e. 'ptrdiff_t')
Relaxes constexpr
restrictions around labels, goto
, and non-literal user-defined types.
constexpr bool f() {
if (std::is_constant_evaluated()) {
return true;
}
goto label;
label:
return false;
}
static_assert(f()); // OK - constant evaluation never reaches the 'goto' statement.
Compiler improvements for 17.13
The categories below are some areas that the team has identified as high impact feature areas of the compiler toolset for customers. The team is dedicated to ensuring the areas below continue to be developed and improved over time, and we thank you all for filing bugs and being patient as our team works through issues.
C++/CLI
- Compiler Hang/Internal Error compiling String::Format in CPP/CLR
- Variable Argument Lists (…) (C++/CLI) no longer compile in .NET preview 9 (17.12.0 Preview)
Diagnostics
constexpr
- decltype(auto) function returning compound assignment cannot be constexpr
- Discrepancy in Behavior of operator= and operator for Multiplying int and double at compile time
- constexpr initializer_list has wrong values
- static constexpr std::initializer_list always zero-inits regardless of actual values
C++ modules
- Fixed issue where SEH statements were not persisted in the IFC.
- /scanDependencies does not take into account macros exported by header units
- Linker error caused by mix of modules and formatter specialization
- [C++ modules] C2504 when nested class derives from a templated nested class
- module can’t handle CRTP within a struct on 17.10.0 Preview 5
- C++ modules code not compiling anymore with Visual Studio version 17.10+
- ICE when using explicit this parameter(Deducing this) in a export{}
- Error C2139 when using nested template classes in modules and type traits
Reliability
- Fix a compiler crash when evaluating a default argument to a static function.
- LINK : fatal error LNK1000: Internal error during IMAGE::BuildImage
- Schwarz counter vs. precompiled header
- VS 2022 17.11.2: Internal Compiler Error When Using Structured Bindings & Explicit Object Member Function
- Internal compiler error with conditionally defaulted special member function and nested expression sfinae
- Compiler crashes for custom implementation of is_destructible
- Error C1001 with Address Sanitizer(vs2022 17.11.2), when a public member of a temporary object is bound to a reference
- internal compiler error while trying to overload bitwise operator
- fatal error C1001: Internal compiler error. (compiler file ‘D:\a_work\1\s\src\vctools\Compiler\Utc\src\p2\main.c’, line 247)
- VS 2022 C++20 internal compiler error w/example
- ICE on class templates with several specialisations and simultaneous pack expansion
- ICE – potentially related to concepts
Correctness
- Fix an issue with processing a mixture of nested and anonymous namespaces.
- [regression] lambda evaluation in unevaluated context in if constexpr condition fails from VS17.6 onwards
- Fix bogus printf format specifier warnings when the format string has a cast
- Fix C2938 when a lambda is used as an alias template argument.
- Fix an issue with
requires
expressions that fail to resolve sometimes resulting in syntax errors. - MSVC will succeed compilation when a variadic parameter, that is defined by a templated type alias that is evaluated using decltype, is ill-formed
- C++: ‘data’ is not a member of std::basic_string_view
- Wrong code generation when initializing a variable of class type that contains multiple instances of the same empty class in its layout
- Simultaneous expansion of two non-type parameter packs inside a class template argument list works incorrectly
- C1XX’s __is_convertible_to intrinsic mis-handles volatile array lvalues
- Enum in struct in template function is broken
- wrong codegen: copy constructor not elided when the type is trivially copyiable but not trivially destroyable.
- Bogus error when using SFINAE with an overload set
- Alias template CTAD failure with initializer list
- False instance of warning 4189 in 17.12 Preview 3
- name lookup bug with nested lambda, template operator (), user defined literal operator
- Incorrect values in global initializer_list
- MSVC rejects valid program involving using declaration for alias used in mem-initializer-list
- std::invocable test fails for a function object with decltype(fold expression) in trailing return type
- Incorrect Microsoft Analyzer warning C26818 triggered
- std::is_nothrow_default_constructible returns true even though class inherits noexcept(false) default constructor
- C++20 coroutine variables are not properly aligned
- Partial template specialization failed with non-type template argument
- [coroutines] Incorrect alignment of structure arguments
- [Regression] [Rejects valid] Wrong concept evaluation in member function (C7601)
- __declspec(dllexport) makes class inherited from view_interface not a range
- Structured binding ambiguity with non-ADL functions
- {new(std::nothrow)int} may be identified as placement new
- BUG for C++ covariant return type and multiple inheritance
- Compiler error when an instance of a struct defined in a lambda, is used as a parameter and that parameter is captured in another lambda
- No deprecation warning for class alias
- deducing lvalue reference for non-type template parameter
- unnamed concept using context variable will give incorrect result
Closing
As always, we welcome your feedback. Feel free to send any comments through e-mail at visualcpp@microsoft.com or through Twitter @visualc. Also, feel free to follow Cameron DaCamara on Twitter @starfreakclone.
If you encounter other problems with MSVC in VS 2022 please let us know via the Report a Problem option, either from the installer or the Visual Studio IDE itself. For suggestions or bug reports, let us know through Developer Community.
0 comments
Be the first to start the discussion.