diff options
author | Akira Hatanaka <ahatanaka@apple.com> | 2019-02-02 02:23:40 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@apple.com> | 2019-02-02 02:23:40 +0000 |
commit | a50489754a60000887c13a04b85c772e867e807a (patch) | |
tree | 5d3fcd655466e570963cec8297570028fbffc302 /clang/lib/Sema/SemaDecl.cpp | |
parent | f82d8924ef7fe20f786d70ee4634be4d5dc508d3 (diff) | |
download | bcm5719-llvm-a50489754a60000887c13a04b85c772e867e807a.tar.gz bcm5719-llvm-a50489754a60000887c13a04b85c772e867e807a.zip |
[Sema][ObjC] Allow declaring ObjC pointer members with non-trivial
ownership qualifications in C++ unions under ARC.
An ObjC pointer member with non-trivial ownership qualifications causes
all of the defaulted special functions of the enclosing union to be
defined as deleted, except when the member has an in-class initializer,
the default constructor isn't defined as deleted.
rdar://problem/34213306
Differential Revision: https://reviews.llvm.org/D57438
llvm-svn: 352949
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 5b6fd880ca8..c8a69c4d537 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -15923,7 +15923,8 @@ void Sema::ActOnFields(Scope *S, SourceLocation RecLoc, Decl *EnclosingDecl, QualType T = Context.getObjCObjectPointerType(FD->getType()); FD->setType(T); } else if (getLangOpts().allowsNonTrivialObjCLifetimeQualifiers() && - Record && !ObjCFieldLifetimeErrReported && Record->isUnion()) { + Record && !ObjCFieldLifetimeErrReported && Record->isUnion() && + !getLangOpts().CPlusPlus) { // It's an error in ARC or Weak if a field has lifetime. // We don't want to report this in a system header, though, // so we just make the field unavailable. |