11-10-2016, 09:10 AM
The preferred method of declaring constants in C++ is 2, though 3 is acceptable in the specific case of declaring or accessing an array.
Your checker shouldn't report 2 as a violation of the ODR (3-1-1)
In a future version or Technical Corrigendum we ought to consider clarifying that 3-1-1 does not apply to const declarations.
If the const were made static, 2-10-5 may also need modification to allow it as an exception
Your checker shouldn't report 2 as a violation of the ODR (3-1-1)
In a future version or Technical Corrigendum we ought to consider clarifying that 3-1-1 does not apply to const declarations.
If the const were made static, 2-10-5 may also need modification to allow it as an exception
Posted by and on behalf of
the MISRA C++ Working Group
the MISRA C++ Working Group