diff options
author | Anders Carlsson <andersca@mac.com> | 2009-12-09 03:44:46 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-12-09 03:44:46 +0000 |
commit | 63fb6737e7488e3af85c822d4d030663e2b4feaf (patch) | |
tree | 1b01fa07a37743a5a350f785605d9f3102512930 /lib/Sema/SemaDecl.cpp | |
parent | d88ea5687968640ada2bc5a10211cbeb68a671ec (diff) |
Don't warn about function templates or function template specializations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90943 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 392360f5aa..617adfe363 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -3998,23 +3998,31 @@ static bool ShouldWarnAboutMissingPrototype(const FunctionDecl *FD) { // 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()) { |