AutosarC++17_03-A7.1.8ΒΆ

A non-type specifier shall be placed before a type specifier in a declaration

Required inputs: IR

Rationale

Placing a non-type specifier, i.e. typedef, friend, constexpr, register, static, extern, thread_local, mutable, inline, virtual, explicit, before type specifiers makes the source code more readable.

Example
// $Id: A7-1-8.cpp 271715 2017-03-23 10:13:51Z piotr.tanski $
#include <cstdint>

typedef std::int32_t int1; // Compliant
std::int32_t typedef int2; // Non-compliant

class C {
public:
virtual inline void f1(); // Compliant
inline virtual void f2(); // Compliant
void virtual inline f3(); // Non-compliant
private:
std::int32_t mutable x; // Non-compliant
mutable std::int32_t y; // Compliant
};
See Also
  • HIC++ v4.0 [8]: 7.1.3 Do not place type specifiers before non-type specifiers in a declaration.

Possible Messages

Key

Text

Severity

Disabled

specifier_order

Non-Type specifier(s) {} used after type specifier.

None

False

Options