diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-09-23 20:23:42 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-09-23 20:23:42 +0000 |
commit | c193dd84414c32b7c66f5b68176401665c0d2301 (patch) | |
tree | 144e546ee8ed9b39a5b9c96573c5b8de0072a4b1 /lib | |
parent | f1f8b1a404d9ce6f0eb78e97b598a220d8ca9090 (diff) |
Don't propagate the 'availability' attribute through declaration
merging for overrides. One might want to make a method's availability
in a superclass different from that of its subclass. Fixes
<rdar://problem/10166223>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140406 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 3878341ca7..da0fa3e12a 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -1493,9 +1493,11 @@ static void mergeDeclAttributes(Decl *newDecl, const Decl *oldDecl, for (specific_attr_iterator<InheritableAttr> i = oldDecl->specific_attr_begin<InheritableAttr>(), e = oldDecl->specific_attr_end<InheritableAttr>(); i != e; ++i) { - // Ignore deprecated and unavailable attributes if requested. + // Ignore deprecated/unavailable/availability attributes if requested. if (!mergeDeprecation && - (isa<DeprecatedAttr>(*i) || isa<UnavailableAttr>(*i))) + (isa<DeprecatedAttr>(*i) || + isa<UnavailableAttr>(*i) || + isa<AvailabilityAttr>(*i))) continue; if (!DeclHasAttr(newDecl, *i)) { |