diff options
author | Akira Hatanaka <ahatanaka@apple.com> | 2019-09-07 00:34:43 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@apple.com> | 2019-09-07 00:34:43 +0000 |
commit | ad203f89e5e8cd0c764ac490a8848c65651485cd (patch) | |
tree | fbe5bafb4b6eff17dcf9db2e31c9d6950e37d3ff /lib/Frontend/CompilerInvocation.cpp | |
parent | a2d3035e5b81fcae4472ba02c8c7a7f9cc675d3c (diff) | |
download | clang-ad203f89e5e8cd0c764ac490a8848c65651485cd.tar.gz |
[Sema] Diagnose default-initialization, destruction, and copying of
non-trivial C union types
This recommits r365985, which was reverted because it broke a few
projects using unions containing non-trivial ObjC pointer fields in
system headers. We now have a patch to fix the problem (see
https://reviews.llvm.org/D65256).
Original commit message:
This patch diagnoses uses of non-trivial C unions and structs/unions
containing non-trivial C unions in the following contexts, which require
default-initialization, destruction, or copying of the union objects,
instead of disallowing fields of non-trivial types in C unions, which is
what we currently do:
- function parameters.
- function returns.
- assignments.
- compound literals.
- block captures except capturing of `__block` variables by non-escaping blocks.
- local and global variable definitions.
- lvalue-to-rvalue conversions of volatile types.
See the discussion in https://reviews.llvm.org/D62988 for more background.
rdar://problem/50679094
Differential Revision: https://reviews.llvm.org/D63753
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371275 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions