Bug 291276
| Summary: | REGRESSION (290899@main): Fix WTF::RetainPtrType when using `id` type | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | David Kilzer (:ddkilzer) <ddkilzer> |
| Component: | New Bugs | Assignee: | David Kilzer (:ddkilzer) <ddkilzer> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | 288291 | ||
| Bug Blocks: | |||
David Kilzer (:ddkilzer)
Fix WTF::RetainPtrType when using `id` type.
This regressed in:
Some RetainPtr cleanup [v2]
https://bugs.webkit.org/show_bug.cgi?id=288291
rdar://145371975
<https://commits.webkit.org/290899@main>
Previously the check was `std::is_convertible_v<T, id> && !std::is_same_v<T, id>`:
```
-#ifdef __OBJC__
- using HelperPtrType = typename std::conditional_t<std::is_convertible_v<T, id> && !std::is_same_v<T, id>, std::remove_pointer_t<T>, T>;
-#else
- using HelperPtrType = PtrType;
-#endif
```
But that changed to `IsNSType<T>`:
```
+template<typename T> using RetainPtrType = std::conditional_t<IsNSType<T>, std::remove_pointer_t<T>, T>;
```
Which is defined as:
```
+template<typename T> constexpr bool IsNSType = std::is_convertible_v<T, id>;
```
<rdar://148273952>
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
David Kilzer (:ddkilzer)
Pull request: https://github.com/WebKit/WebKit/pull/43804
EWS
Committed 293440@main (43dfb26178e8): <https://commits.webkit.org/293440@main>
Reviewed commits have been landed. Closing PR #43804 and removing active labels.