Rule A2-5-1 (required, implementation, automated)
Trigraphs shall not be used.
Rationale
Trigraphs are denoted to be a sequence of 2 question marks followed by a specified third character (e.g. ??’ represents a ~character. They can cause accidental confusion with other uses of two question marks. The Trigraphs are: ??=, ??/, ??’, ??(, ??), ??!, ??<, ??>, ??-.
Example
//% $Id: A2-5-1.cpp 289436 2017-10-04 10:45:23Z michal.szczepankiewicz $
#include <iostream>
void Fn1()
{
std::cout << "Enter date ??/??/??"; // Non-compliant, ??/??/?? becomes \\??
// after trigraph translation
}
void Fn2()
{
std::cout << "Enter date dd/mm/yy"; // Compliant
}
See also
MISRA C++2008: Rule 2-3-1 (Required) Trigraphs shall not be used.
JSF December 2005 [8]: AV Rule 11 Trigraphs will not be used.
HIC++ v4.0 [9]: 2.2.1 Do not use digraphs or trigraphs.