Index: clang/lib/StaticAnalyzer/Core/RetainSummaryManager.cpp =================================================================== --- clang/lib/StaticAnalyzer/Core/RetainSummaryManager.cpp +++ clang/lib/StaticAnalyzer/Core/RetainSummaryManager.cpp @@ -241,7 +241,9 @@ // All objects returned with functions *not* starting with // get, or iterators, are returned at +1. - if (!II->getName().startswith("get") || isOSIteratorSubclass(PD)) { + if ((!II->getName().startswith("get") && + !II->getName().startswith("Get")) || + isOSIteratorSubclass(PD)) { return getOSSummaryCreateRule(FD); } else { return getOSSummaryGetRule(FD); Index: clang/test/Analysis/osobject-retain-release.cpp =================================================================== --- clang/test/Analysis/osobject-retain-release.cpp +++ clang/test/Analysis/osobject-retain-release.cpp @@ -20,6 +20,9 @@ static OSObject *generateObject(int); + static OSObject *getObject(); + static OSObject *GetObject(); + static const OSMetaClass * const metaClass; }; @@ -55,6 +58,14 @@ static OSObject *safeMetaCast(const OSObject *inst, const OSMetaClass *meta); }; +void check_get_object() { + OSObject::getObject(); +} + +void check_Get_object() { + OSObject::GetObject(); +} + void check_custom_iterator_rule(OSArray *arr) { OSIterator *it = arr->getIterator(); it->release();