This revision was automatically updated to reflect the committed changes.
Closed by commit rC330202: [Sema] Warn about memcpying non-trivial C
structs. (authored by ahatanak, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D45310?vs=142705=142815#toc
Repository:
rC Clang
rjmccall accepted this revision.
rjmccall added a comment.
This revision is now accepted and ready to land.
Thanks; LGTM.
Repository:
rC Clang
https://reviews.llvm.org/D45310
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
ahatanak updated this revision to Diff 142705.
ahatanak marked an inline comment as done.
ahatanak added a comment.
Fix indentation.
Repository:
rC Clang
https://reviews.llvm.org/D45310
Files:
include/clang/AST/NonTrivialTypeVisitor.h
include/clang/Basic/DiagnosticSemaKinds.td
rjmccall added inline comments.
Comment at: lib/Sema/SemaChecking.cpp:7651
+ << PointeeTy << 1);
+ SearchNonTrivialToCopyField::diag(PointeeTy, Dest, *this);
+ } else {
Indentation seems messed up in these two
ahatanak added inline comments.
Comment at: include/clang/AST/NonTrivialCStructTypeVisitor.h:30
+if (asDerived().getContext().getAsArrayType(FT))
+ return asDerived().visitArray(DK, FT, std::forward(Args)...);
+
rjmccall wrote:
> ahatanak wrote:
> >
ahatanak updated this revision to Diff 142691.
ahatanak marked an inline comment as done.
ahatanak added a comment.
Move method visitArray to the derived classes and pass the array type to the
method instead of the QualType.
Repository:
rC Clang
https://reviews.llvm.org/D45310
Files:
rjmccall added inline comments.
Comment at: include/clang/AST/NonTrivialCStructTypeVisitor.h:30
+if (asDerived().getContext().getAsArrayType(FT))
+ return asDerived().visitArray(DK, FT, std::forward(Args)...);
+
ahatanak wrote:
> rjmccall wrote:
> >
ahatanak updated this revision to Diff 141291.
ahatanak marked 3 inline comments as done.
ahatanak added a comment.
Address review comments.
Repository:
rC Clang
https://reviews.llvm.org/D45310
Files:
include/clang/AST/NonTrivialTypeVisitor.h
include/clang/Basic/DiagnosticSemaKinds.td
ahatanak added inline comments.
Comment at: include/clang/AST/NonTrivialCStructTypeVisitor.h:30
+if (asDerived().getContext().getAsArrayType(FT))
+ return asDerived().visitArray(DK, FT, std::forward(Args)...);
+
rjmccall wrote:
> Should you have this
rjmccall added inline comments.
Comment at: include/clang/AST/NonTrivialCStructTypeVisitor.h:12
+//
+//===--===//
+
The header comment here was clearly just copied from another file.
I would
ahatanak created this revision.
ahatanak added a reviewer: rjmccall.
Issue a warning when non-trivial C structs (structs with '__weak' or '__strong'
fields) are copied or initialized by calls to memset, bzero, memcpy, and
memmove. This is similar to gcc's -Wclass-memaccess warning. It might be
11 matches
Mail list logo