Skip to main content

IAR Embedded Workbench for RH850 3.20.x

MISRAC++2023-4.1.2_a

In this section:
Synopsis

(Advisory) Deprecated features should not be used

Enabled by default

No

Severity/Certainty

Low/Medium

lowmedium.png
Full description

Deprecated feature found [depr.impldec]

Coding standards

This check does not correspond to any coding standard rules.

Code examples

The following code example fails the check and will give a warning:

struct WithDtor
{
  ~WithDtor() = default;
  int x;
};

void example() {
  WithDtor a {};    // Compliant - no use of copy constructor
  WithDtor b { a }; // Non-compliant - [depr.impldec]
}

The following code example passes the check and will not give a warning about this issue:

struct WithNoDtor
{
  int x;
};

void example() {
  WithNoDtor a {};    // Compliant - no use of copy constructor
  WithNoDtor b { a }; // Compliant
}