// Don't warn about invalid declarations.
if (FD->isInvalidDecl())
return false;
-
+
// Or declarations that aren't global.
if (!FD->isGlobal())
return false;
-
+
// Don't warn about C++ member functions.
if (isa<CXXMethodDecl>(FD))
return false;
-
+
// Don't warn about 'main'.
if (FD->isMain())
return false;
-
+
// Don't warn about inline functions.
if (FD->isInlineSpecified())
return false;
-
+
+ // Don't warn about function templates.
+ if (FD->getDescribedFunctionTemplate())
+ return false;
+
+ // Don't warn about function template specializations.
+ if (FD->isFunctionTemplateSpecialization())
+ return false;
+
bool MissingPrototype = true;
for (const FunctionDecl *Prev = FD->getPreviousDeclaration();
Prev; Prev = Prev->getPreviousDeclaration()) {
}
namespace {
- // Should not warn about anonymous namespaces
+ // Don't warn about functions in anonymous namespaces.
void f() { }
}
struct A {
- // Should not warn about member functions.
+ // Don't warn about member functions.
void f() { }
};
-inline void g() { }
\ No newline at end of file
+// Don't warn about inline functions.
+inline void g() { }
+
+// Don't warn about function templates.
+template<typename> void h() { }
+
+// Don't warn when instantiating function templates.
+template void h<int>();