Rule A2-5-2 (required, implementation, automated)

Digraphs shall not be used.

Rationale

The digraphs are: <%, %>, <:, :>, %:, %:%:. The use of digraphs may not meet developer expectations.

Example

//% $Id: A2-5-2.cpp 305382 2018-01-26 06:32:15Z michal.szczepankiewicz $
class A
{
public:
void F2() {}
};

// void fn1(A* a<:10:>) // Non-compliant

// <%
//
a<:0:>->f2();
// %>

void Fn2(A* a[10]) // Compliant, equivalent to the above

{
a[0]->F2();

}

See also

MISRA C++ 2008 [7]: advisory 2-5-1 Digraphs should not be used. JSF December 2005 [8]: 4.4.1 AV Rule 12 The following digraphs will not be used. HIC++ v4.0 [9]: 2.2.1 Do not use digraphs or trigraphs.