alexfh requested changes to this revision.
alexfh added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang-tidy/misc/DefinitionsInHeadersCheck.cpp:131-135
+    if (FD->getTemplateSpecializationKind() != TSK_Undeclared)
+      diag(FD->getLocation(), "this is a full function template specilization "
+                              "which behaves as a regular function, so the ODR 
"
+                              "still applies",
+           DiagnosticIDs::Note);
----------------
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.


https://reviews.llvm.org/D29928



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to