
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
68 lines
1.4 KiB
Plaintext
68 lines
1.4 KiB
Plaintext
== Why is this an issue?
|
|
|
|
Class templates can be explicitly or partially specialized. But according to the {cpp} standard, function templates cannot be partially specialized. Under certain conditions, the Microsoft® compiler will silently ignore the confusing application of partial specialization syntax to a function, but other compilers will raise an error for it and fail compilation.
|
|
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,cpp]
|
|
----
|
|
template<typename T>
|
|
void fun(T p);
|
|
|
|
template<typename T>
|
|
void fun<T>(T p) { // Noncompliant
|
|
// ...
|
|
}
|
|
----
|
|
|
|
|
|
=== Compliant solution
|
|
|
|
[source,cpp]
|
|
----
|
|
template<typename T>
|
|
void fun(T p);
|
|
|
|
template<typename T>
|
|
void fun(T p) {
|
|
// ...
|
|
}
|
|
----
|
|
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
=== Message
|
|
|
|
Remove the template arguments from this function template.
|
|
|
|
|
|
=== Highlighting
|
|
|
|
----
|
|
template<typename T>
|
|
void fun<T>(T p) {
|
|
// ^^^^^^ the template-id
|
|
----
|
|
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
=== on 1 Aug 2016, 16:12:50 Tstock wrote:
|
|
Hi I found a NPE in Java plugin, but I've no permissioin to create an new issue. Can you help me? -- feel free to delete this post
|
|
|
|
=== on 1 Aug 2016, 16:48:03 Ann Campbell wrote:
|
|
Hi [~tstocknm], thanks for reporting, but this isn't the place to do it. :-)
|
|
|
|
Instead, please open a new thread on the https://groups.google.com/forum/?pli=1#!forum/sonarqube[SonarQube Google Group]
|
|
|
|
endif::env-github,rspecator-view[]
|