Index: cfe/trunk/include/clang/StaticAnalyzer/Core/RetainSummaryManager.h =================================================================== --- cfe/trunk/include/clang/StaticAnalyzer/Core/RetainSummaryManager.h +++ cfe/trunk/include/clang/StaticAnalyzer/Core/RetainSummaryManager.h @@ -139,7 +139,7 @@ OwnedWhenTrackedReceiver, // Treat this function as returning a non-tracked symbol even if // the function has been inlined. This is used where the call - // site summary is more presise than the summary indirectly produced + // site summary is more precise than the summary indirectly produced // by inlining the function NoRetHard }; Index: cfe/trunk/lib/StaticAnalyzer/Core/RetainSummaryManager.cpp =================================================================== --- cfe/trunk/lib/StaticAnalyzer/Core/RetainSummaryManager.cpp +++ cfe/trunk/lib/StaticAnalyzer/Core/RetainSummaryManager.cpp @@ -478,8 +478,12 @@ Summ = getFunctionSummary(cast(Call).getDecl()); break; case CE_CXXMemberOperator: - case CE_Block: + Summ = getFunctionSummary(cast(Call).getDecl()); + break; case CE_CXXConstructor: + Summ = getFunctionSummary(cast(Call).getDecl()); + break; + case CE_Block: case CE_CXXDestructor: case CE_CXXAllocator: // FIXME: These calls are currently unsupported. Index: cfe/trunk/test/Analysis/osobject-retain-release.cpp =================================================================== --- cfe/trunk/test/Analysis/osobject-retain-release.cpp +++ cfe/trunk/test/Analysis/osobject-retain-release.cpp @@ -43,6 +43,7 @@ struct OtherStruct { static void doNothingToArray(OSArray *array); + OtherStruct(OSArray *arr); }; struct OSMetaClassBase { @@ -55,6 +56,12 @@ } // expected-warning{{Potential leak of an object stored into 'arr'}} // expected-note@-1{{Object leaked}} +void check_no_invalidation_other_struct() { + OSArray *arr = OSArray::withCapacity(10); // expected-note{{Call to function 'withCapacity' returns an OSObject of type struct OSArray * with a +1 retain count}} + OtherStruct other(arr); // expected-warning{{Potential leak}} + // expected-note@-1{{Object leaked}} +} + void check_rc_consumed() { OSArray *arr = OSArray::withCapacity(10); OSArray::consumeArray(arr);