Rule A1-1-1 (required, implementation, automated)

All code shall conform to ISO/IEC 14882:2014 - Programming Language C++ and shall not use deprecated features.

Rationale

The current version of the C++ language is as defined by the ISO International Standard ISO/IEC 14822:2014(E) "Information technology - Programming languages

  • C++". The C++14 is the improved version of the C++11. It is also “the state of the art” of C++ development that is required by ISO 26262 standard [6]. Any reference in this document to “C++ Language Standard” refers to the ISO/IEC Note that all of the deprecated features of C++ Language Standard are defined in ISO/IEC 14882:2014 - Programming Language C++ Annexes C “Compatibility” and D “Compatibility features”.

Example

//% $Id: A1-1-1.cpp 289436 2017-10-04 10:45:23Z michal.szczepankiewicz $
#include <cstdint>
#include <stdexcept>
void F(std::int32_t i)
{
std::int32_t* a = nullptr;

// __try // Non-compliant - __try is a part of Visual Studio extension
try // Compliant - try keyword is a part of C++ Language Standard
{
a = new std::int32_t[i];
// ...
}

// __finally // Non-compliant - __finally is a part of Visual Studio
// extension
catch (
std::exception&) // Compliant - C++ Language Standard does not define
// finally block, only try and catch blocks
{
delete[] a;
a = nullptr;
}

}

See also

MISRA C++ 2008 [7]: 1-0-1 All code shall conform to ISO/IEC 14882:2003 “The C++ Standard Incorporating Technical Corrigendum 1”

JSF December 2005 [8]: 4.4.1 All code shall conform to ISO/IEC HIC++ v4.0 [9]: 1.1.1 Ensure that code complies with the 2011 ISO C++ Language Standard. HIC++ v4.0 [9]: 1.3.4 Do not use deprecated STL library features.