Fred Tingaud 51369b610e
Make sure that includes are always surrounded by empty lines (#2270)
When an include is not surrounded by empty lines, its content is inlined
on the same line as the adjacent content. That can lead to broken tags
and other display issues.
This PR fixes all such includes and introduces a validation step that
forbids introducing the same problem again.
2023-06-22 10:38:01 +02:00

55 lines
1.1 KiB
Plaintext

If 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.
== Noncompliant Code Example
----
void f ( short ); // Example 1
template <typename T> void f ( T ); // Example 2
void b ( short s )
{
f ( s ); // Noncompliant - Calls Example 1
f ( s + 1 ); // Noncompliant - Calls Example 2
}
----
== Compliant Solution
----
void f ( short ); // Example 1
template <typename T> void f ( T ); // Example 2
void b ( short s )
{
f<>( s ); // Compliant - Explicitly calls Example 2
f<>( s + 1 ); // Compliant - Explicitly calls Example 2
}
----
== Exceptions
This rule does not apply to copy constructors or copy assignment operators.
== See
* MISRA {cpp}:2008, 14-8-2
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]