diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-05-03 18:11:37 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-05-03 18:11:37 +0000 |
commit | e452c78072156c14cd9998733e3b4b28b6fc7fd7 (patch) | |
tree | e7dcfa2b59e65674d476b82470ce872f2f52e7ac /lib/Sema/SemaChecking.cpp | |
parent | 2bc0e5d955dbee5518afa59e1c66025a78b097f1 (diff) |
Only check the use of memset() if we're refering to a C function named
'memset' with external linkage.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130770 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index dcfb7cc521..ee1a924e5a 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -319,7 +319,9 @@ bool Sema::CheckFunctionCall(FunctionDecl *FDecl, CallExpr *TheCall) { } // Memset handling - if (FnInfo->isStr("memset")) + if (FnInfo->isStr("memset") && + FDecl->getLinkage() == ExternalLinkage && + (!getLangOptions().CPlusPlus || FDecl->isExternC())) CheckMemsetArguments(TheCall); return false; |