Rule A7-1-8 (required, implementation, automated)
A non-type specifier shall be placed before a type specifier in a declaration.
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 289436 2017-10-04 10:45:23Z michal.szczepankiewicz $
#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 [9]: 7.1.3 Do not place type specifiers before non-type specifiers in a declaration.