[PATCH] D65256: [Sema][ObjC] Mark C union fields that have non-trivial ObjC ownership qualifications as unavailable if the union is declared in a system header
John McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 6 11:15:48 PDT 2019
rjmccall added inline comments.
Herald added a subscriber: ychen.
================
Comment at: lib/Sema/SemaDecl.cpp:11142
+bool ignoreForTrivialityComputation(const FieldDecl *FD) {
+ // Ignore unavailable fields since they don't affect the triviality of the
----------------
`shouldIgnoreForRecordTriviality` or something like that, please.
================
Comment at: lib/Sema/SemaDecl.cpp:11144
+ // Ignore unavailable fields since they don't affect the triviality of the
+ // containing struct/union.
+ return FD->hasAttr<UnavailableAttr>();
----------------
The "since" clause here is circular: this function *defines* what affects the triviality. The comment should talk about the motivations (e.g. fields that aren't available in particular language modes) and why this might be okay or is the best-available option (despite e.g. the potential for ABI incompatibility across language modes),
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65256/new/
https://reviews.llvm.org/D65256
More information about the cfe-commits
mailing list