Bug 256311 - RetainPtr<>::leakRef() should have NS/CF_RETURNS_RETAINED attributes
Summary: RetainPtr<>::leakRef() should have NS/CF_RETURNS_RETAINED attributes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-05-04 09:07 PDT by David Kilzer (:ddkilzer)
Modified: 2023-05-05 18:58 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2023-05-04 09:07:46 PDT
RetainPtr<>::leakRef() should have NS/CF_RETURNS_RETAINED attributes.

This will let the clang static analyzer do a better job of detecting leaks.

The trick to making this work is using `template<typename U = T>` to allow for template specialization and SFINAE without using the template type (`T`) for the entire class, as noted here:
<https://stackoverflow.com/questions/11531989/what-happened-to-my-sfinae-redux-conditional-template-class-members>
Comment 1 Radar WebKit Bug Importer 2023-05-04 09:08:11 PDT
<rdar://problem/108895655>
Comment 2 David Kilzer (:ddkilzer) 2023-05-04 11:42:10 PDT
Pull request: https://github.com/WebKit/WebKit/pull/13451
Comment 3 EWS 2023-05-05 18:58:03 PDT
Committed 263742@main (611c1a1ceeaf): <https://commits.webkit.org/263742@main>

Reviewed commits have been landed. Closing PR #13451 and removing active labels.