]> granicus.if.org Git - clang/commit
[Sema] Warn about memcpy'ing non-trivial C structs.
authorAkira Hatanaka <ahatanaka@apple.com>
Tue, 17 Apr 2018 19:13:41 +0000 (19:13 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Tue, 17 Apr 2018 19:13:41 +0000 (19:13 +0000)
commitaceeee6ed4acfbe7b7e12e727de58ef6013c1e4f
tree94b61e9d74ebd3cecf984d10ae22fa7bf691c9cc
parent4889058f23607ff086470afe013082ca4a278ddb
[Sema] Warn about memcpy'ing non-trivial C structs.

Issue a warning when non-trivial C structs are copied or initialized by
calls to memset, bzero, memcpy, or memmove.

rdar://problem/36124208

Differential Revision: https://reviews.llvm.org/D45310

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330202 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaChecking.cpp
test/SemaObjC/warn-nontrivial-struct-memaccess.m [new file with mode: 0644]