Main Content

C++20 Language Elements Supported in Polyspace

This table provides a partial list of C++ language elements that have been introduced since C++20 and its corresponding Polyspace® support. If your code contains unsupported features or libraries, Polyspace reports a compilation error.

For details about these new features, see C++20.

FeatureSupported
New lambda capture [=,this]Yes
New macro __VA_OPT__Yes
Designated initializerYes
Lambda expressions with an explicit template parameter listYes
Default member initializers for bit-fieldsYes
Initializer list constructors in class template argument deductionYes
const&-qualified pointers to membersYes
ConceptsYes
Lambdas disallowed in certain contextsYes
Three-way comparison operatorYes
init-statements for range-based forYes
Default constructible and assignable stateless lambdasYes
Access checking on specializationsYes
ADL and function templates that are not visibleYes
Attributes [[likely]] and [[unlikely]]Yes
Make typename more optionalYes
Pack expansion in lambda init-captureYes
Attribute [[no_unique_address]]Yes
Conditionally Trivial Special Member FunctionsYes
Relaxing the structured bindings customization point finding rulesYes
Relaxing the range-for loop customization point finding rulesYes
Allow structured bindings to accessible membersYes
Destroying operator deleteYes
Class types in non-type template parametersYes
Deprecate implicit capture of this via [=]Yes
explicit(bool)Yes
Integrating feature-test macrosYes
Prohibit aggregates with user-declared constructorsYes
constexpr virtual functionYes
char8_tYes
std::is_constant_evaluated()Yes
constexpr try-catch blocksYes
Immediate functions (consteval)Yes
Nested inline namespacesYes
Yet another approach for constrained declarationsYes
dynamic_cast and polymorphic typeid in constant expressionsYes
Changing the active member of a union inside constexprYes
Parenthesized initialization of aggregatesYes
CoroutinesYes
Array size deduction in new-expressionsYes
<=> != ==Yes
Explicitly defaulted functions with different exception specificationsYes
Lambda capture and storage class specifiers of structured bindingsYes
Permit conversions to arrays of unknown boundYes
constexpr container operationsYes
costinitYes
[[nodiscard]] with messageYes
Trivial default initialization in constexpr functionsYes
Unevaluated asm-declaration in constexpr functionsYes
using enumYes
Synthesizing three-way comparison for specified comparison categoryYes
[[nodiscard]] for constructorsYes
Class template argument deduction for alias templatesYes
Class template argument deduction for aggregatesYes
Implicit move for more local objects and rvalue referencesYes
Structural types as non-type template argumentYes

See Also

Topics

External Websites