Index: lib/Sema/SemaType.cpp =================================================================== --- lib/Sema/SemaType.cpp +++ lib/Sema/SemaType.cpp @@ -4229,7 +4229,7 @@ } } - if (LangOpts.ObjCAutoRefCount && Param->hasAttr()) { + if (Param->hasAttr()) { ExtParameterInfos[i] = ExtParameterInfos[i].withIsConsumed(true); HasAnyInterestingExtParameterInfos = true; } Index: test/CodeGenObjCXX/arc-mangle.mm =================================================================== --- test/CodeGenObjCXX/arc-mangle.mm +++ test/CodeGenObjCXX/arc-mangle.mm @@ -18,6 +18,8 @@ void f(const __unsafe_unretained id *) {} // CHECK-LABEL: define {{.*}}void @_Z1fPFU19ns_returns_retainedP11objc_objectvE void f(__attribute__((ns_returns_retained)) id (*fn)()) {} +// CHECK-LABEL: define {{.*}}void @_Z1fU11ns_consumedP11objc_object +void f(id __attribute((ns_consumed))) {} // CHECK-LABEL: define {{.*}}void @_Z1fPFP11objc_objectU11ns_consumedS0_S0_E void f(id (*fn)(__attribute__((ns_consumed)) id, id)) {} // CHECK-LABEL: define {{.*}}void @_Z1fPFP11objc_objectS0_U11ns_consumedS0_E Index: test/CodeGenObjCXX/mangle.mm =================================================================== --- test/CodeGenObjCXX/mangle.mm +++ test/CodeGenObjCXX/mangle.mm @@ -113,3 +113,10 @@ // CHECK-LABEL: define void @_Z19parameterized_test3P13Parameterized void parameterized_test3(Parameterized *p) {} + +// CHECK-LABEL: define {{.*}}void @_Z1fU11ns_consumedP11objc_object +void f(id __attribute((ns_consumed))) {} +// CHECK-LABEL: define {{.*}}void @_Z1fPFP11objc_objectU11ns_consumedS0_S0_E +void f(id (*fn)(__attribute__((ns_consumed)) id, id)) {} +// CHECK-LABEL: define {{.*}}void @_Z1fPFP11objc_objectS0_U11ns_consumedS0_E +void f(__strong id (*fn)(id, __attribute__((ns_consumed)) id)) {}