MISRA.FUNC.SPEC.NOTSPECViable function set for a function call contains both specializations and non-specializations. MISRA-C++ Rule 14-8-2 (advisory): The viable function set for a function call should either contain no function specializations, or only contain function specializations.RationaleIf a function and a specialization of a function template are deemed equivalent after overload resolution, the non-specialized function will be chosen over the function specialization, which may be inconsistent with developer expectations. ExceptionThis rule does not apply to copy constructors or copy assignment operators. Examplevoid f ( short ); // Example 1 template <typename T> void f ( T ); // Example 2 void b ( short s ) { f ( s ); // Non-compliant - Calls Example 1 f ( s + 1 ); // Non-compliant - Calls Example 2 f<>( s ); // Compliant - Explicitly calls Example 2 f<>( s + 1 ); // Compliant - Explicitly calls Example 2 } |