aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorErik Pilkington <erik.pilkington@gmail.com>2019-03-26 23:21:22 +0000
committerErik Pilkington <erik.pilkington@gmail.com>2019-03-26 23:21:22 +0000
commit818698010cd47b6ed76b58f06eb9ac62045eb0aa (patch)
treecbc373ceb079136ececd951de457b1e97cef760c /clang/lib/Sema/SemaChecking.cpp
parent14f6d1527c706d0749bad224fb6a4d2586d608f4 (diff)
downloadllvm-818698010cd47b6ed76b58f06eb9ac62045eb0aa.zip
llvm-818698010cd47b6ed76b58f06eb9ac62045eb0aa.tar.gz
llvm-818698010cd47b6ed76b58f06eb9ac62045eb0aa.tar.bz2
Emit -Wfortify-source using DiagRuntimeBehaviour
This fixes a false positive on the following, where st is configured to have different sizes based on some preprocessor logic: if (sizeof(buf) == sizeof(*st)) memcpy(&buf, st, sizeof(*st)); llvm-svn: 357041
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r--clang/lib/Sema/SemaChecking.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index b9b14a0..df77ab9 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -431,9 +431,10 @@ void Sema::checkFortifiedBuiltinMemoryFunction(FunctionDecl *FD,
FunctionName = FunctionName.drop_front(std::strlen("__builtin_"));
}
- Diag(TheCall->getBeginLoc(), DiagID)
- << FunctionName << ObjectSize.toString(/*Radix=*/10)
- << UsedSize.toString(/*Radix=*/10);
+ DiagRuntimeBehavior(TheCall->getBeginLoc(), TheCall,
+ PDiag(DiagID)
+ << FunctionName << ObjectSize.toString(/*Radix=*/10)
+ << UsedSize.toString(/*Radix=*/10));
}
static bool SemaBuiltinSEHScopeCheck(Sema &SemaRef, CallExpr *TheCall,