Index: clang/include/clang/Sema/ParsedAttr.h =================================================================== --- clang/include/clang/Sema/ParsedAttr.h +++ clang/include/clang/Sema/ParsedAttr.h @@ -659,6 +659,7 @@ class AttributePool { friend class AttributeFactory; + friend class ParsedAttributes; AttributeFactory &Factory; llvm::TinyPtrVector Attrs; @@ -892,6 +893,13 @@ pool.takeAllFrom(attrs.pool); } + void takeOneFrom(ParsedAttributes &attrs, ParsedAttr *attr) { + attrs.getPool().remove(attr); + attrs.remove(attr); + getPool().add(attr); + addAtEnd(attr); + } + void clear() { clearListOnly(); pool.clear(); Index: clang/lib/Sema/SemaType.cpp =================================================================== --- clang/lib/Sema/SemaType.cpp +++ clang/lib/Sema/SemaType.cpp @@ -534,8 +534,8 @@ // attribute from being applied multiple times and gives // the source-location-filler something to work with. state.saveDeclSpecAttrs(); - moveAttrFromListToList(attr, declarator.getAttributes(), - declarator.getMutableDeclSpec().getAttributes()); + declarator.getMutableDeclSpec().getAttributes().takeOneFrom( + declarator.getAttributes(), &attr); return; } } Index: clang/test/SemaObjC/arc-property-decl-attrs.m =================================================================== --- clang/test/SemaObjC/arc-property-decl-attrs.m +++ clang/test/SemaObjC/arc-property-decl-attrs.m @@ -287,3 +287,5 @@ @synthesize collision = _collision; // expected-note {{property synthesized here}} @end + +id i1, __weak i2, i3;