summaryrefslogtreecommitdiffstats
path: root/include/clang/Basic/LangOptions.h
diff options
context:
space:
mode:
authorBrian Kelley <bkelley@microsoft.com>2017-03-29 18:09:02 +0000
committerBrian Kelley <bkelley@microsoft.com>2017-03-29 18:09:02 +0000
commit1cd6beccb6bb876db3bbfa763e8979d3b363f1fa (patch)
treec4adfa94b2c05c544414be95ed07ed5d4aadb637 /include/clang/Basic/LangOptions.h
parentfa2e39d0daba9ee49c3c1ef7b3b643d5e2c228aa (diff)
[Objective-C] Fix "weak-unavailable" warning with -fobjc-weak
Summary: clang should produce the same errors Objective-C classes that cannot be assigned to weak pointers under both -fobjc-arc and -fobjc-weak. Check for ObjCWeak along with ObjCAutoRefCount when analyzing pointer conversions. Add an -fobjc-weak pass to the existing arc-unavailable-for-weakref test cases to verify the behavior is the same. Reviewers: rsmith, doug.gregor, rjmccall Reviewed By: rjmccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D31006 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299014 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/LangOptions.h')
-rw-r--r--include/clang/Basic/LangOptions.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/clang/Basic/LangOptions.h b/include/clang/Basic/LangOptions.h
index 3f2c4a1649..cfbcbecc5f 100644
--- a/include/clang/Basic/LangOptions.h
+++ b/include/clang/Basic/LangOptions.h
@@ -170,6 +170,11 @@ public:
/// \brief Is this a libc/libm function that is no longer recognized as a
/// builtin because a -fno-builtin-* option has been specified?
bool isNoBuiltinFunc(StringRef Name) const;
+
+ /// \brief True if any ObjC types may have non-trivial lifetime qualifiers.
+ bool allowsNonTrivialObjCLifetimeQualifiers() const {
+ return ObjCAutoRefCount || ObjCWeak;
+ }
};
/// \brief Floating point control options