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 | b1fa14883755af470c8b3ffab3aedb477a899854 (patch) | |
tree | fd468de79e0c97941765deae605a34005a262cff /clang/lib | |
parent | 021baa373f58a21a3e2169c2f22f7dc58a987e96 (diff) | |
download | bcm5719-llvm-b1fa14883755af470c8b3ffab3aedb477a899854.tar.gz bcm5719-llvm-b1fa14883755af470c8b3ffab3aedb477a899854.zip |
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>.
llvm-svn: 140406
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 3878341ca7a..da0fa3e12a7 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/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)) { |