Users might get confused easily when they see the check's message on
full template function speciliations.
Add a note to the output message, which mentions these kind of function
specializations are treated as regular functions.
Differential D29928
[clang-tidy] Improve diagnostic message for misc-definitions-in-header. hokein on Feb 14 2017, 12:53 AM. Authored by
Details Users might get confused easily when they see the check's message on Add a note to the output message, which mentions these kind of function
Diff Detail
Event Timeline
|
Notes are useful for pointing at related but different locations (e.g. point to the declaration of an entity when the diagnostic is issued at a reference to the entity).
Here I would suggest just issuing a different message (e.g. diag(..., "%select{function|full function template specialization}0 %1 defined in a header file ....") << (FD->getTemplateSpecializationKind() != TSK_Undeclared) << FD << ...;) or if it seems more helpful, add a note pointing to the template being specialized.