Skip to content
Snippets Groups Projects
  • Brian Kelley's avatar
    b18f3efe
    [Objective-C] C++ Classes with __weak Members non-POD Types when using -fobjc-weak · b18f3efe
    Brian Kelley authored
    Summary: When adding an Objective-C retainable type member to a C++ class, also check the LangOpts.ObjCWeak flag and the lifetime qualifier so __weak qualified Objective-C pointer members cause the class to be a non-POD type with non-trivial special members, so the compiler always emits the necessary runtime calls for copying, moving, and destroying the weak member. Otherwise, Objective-C++ classes with weak Objective-C pointer members compiled with -fobjc-weak exhibit undefined behavior if the C++ class is classified as a POD type.
    
    Reviewers: rsmith, benlangmuir, doug.gregor, rjmccall
    
    Reviewed By: rjmccall
    
    Subscribers: cfe-commits
    
    Differential Revision: https://reviews.llvm.org/D31003
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299008 91177308-0d34-0410-b5e6-96231b3b80d8
    b18f3efe
    History
    [Objective-C] C++ Classes with __weak Members non-POD Types when using -fobjc-weak
    Brian Kelley authored
    Summary: When adding an Objective-C retainable type member to a C++ class, also check the LangOpts.ObjCWeak flag and the lifetime qualifier so __weak qualified Objective-C pointer members cause the class to be a non-POD type with non-trivial special members, so the compiler always emits the necessary runtime calls for copying, moving, and destroying the weak member. Otherwise, Objective-C++ classes with weak Objective-C pointer members compiled with -fobjc-weak exhibit undefined behavior if the C++ class is classified as a POD type.
    
    Reviewers: rsmith, benlangmuir, doug.gregor, rjmccall
    
    Reviewed By: rjmccall
    
    Subscribers: cfe-commits
    
    Differential Revision: https://reviews.llvm.org/D31003
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299008 91177308-0d34-0410-b5e6-96231b3b80d8
Code owners
Assign users and groups as approvers for specific file changes. Learn more.