Skip to main content

IAR Embedded Workbench for RH850 3.20.x

MISRAC++2023-0.2.3 (C++ only)

In this section:
Synopsis

(Advisory) Types with limited visibility should be used at least once

Enabled by default

No

Severity/Certainty

Low/Medium

lowmedium.png
Full description

Found unused type

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:

namespace {
  struct IntVal  // Not used
  {
    int v;
  };
}

void example()
{
}

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

namespace {
  struct IntVal
  {
    int v;
  };
}

int example()
{
  IntVal n{1};
  return n.v;
}