Bug 234546 - MSVC reports "SVGPropertyAnimator.h(94): error C2839: invalid return type 'T *' for overloaded 'operator ->'" with /std:c++20
Summary: MSVC reports "SVGPropertyAnimator.h(94): error C2839: invalid return type 'T ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Fujii Hironori
URL:
Keywords: InRadar
Depends on:
Blocks: 233448
  Show dependency treegraph
 
Reported: 2021-12-20 21:30 PST by Fujii Hironori
Modified: 2022-02-01 14:49 PST (History)
12 users (show)

See Also:


Attachments
Patch (1.63 KB, patch)
2021-12-20 21:37 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch for landing (1.63 KB, patch)
2021-12-20 23:17 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch (1.94 KB, patch)
2022-02-01 13:35 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fujii Hironori 2021-12-20 21:30:56 PST
MSVC reports "SVGPropertyAnimator.h(94): error C2839: invalid return type 'T *' for overloaded 'operator ->'" with /std:c++20

> Source\WebCore\svg\properties\SVGPropertyAnimator.h(94): error C2839: invalid return type 'T *' for overloaded 'operator ->'
> Source\WebCore\svg\properties\SVGPropertyAnimator.h(102): note: see reference to class template instantiation 'WebCore::SVGPropertyAnimator<AnimationFunction>' being compiled
> Source\WebCore\svg\properties\SVGPropertyAnimator.h(94): error C2039: 'isSVGElement': is not a member of 'WTF::RefPtr'
Comment 1 Fujii Hironori 2021-12-20 21:37:59 PST
Created attachment 447688 [details]
Patch
Comment 2 Alex Christensen 2021-12-20 22:46:33 PST
Comment on attachment 447688 [details]
Patch

auto*
Comment 3 Fujii Hironori 2021-12-20 23:17:27 PST
Created attachment 447691 [details]
Patch for landing

Thank you for the review.
Comment 4 EWS 2021-12-21 00:30:11 PST
Committed r287300 (245452@main): <https://commits.webkit.org/245452@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 447691 [details].
Comment 5 Radar WebKit Bug Importer 2021-12-21 00:31:19 PST
<rdar://problem/86757805>
Comment 6 Darin Adler 2021-12-21 01:05:33 PST
Comment on attachment 447691 [details]
Patch for landing

This change is going in the opposite direction that our future code is going. Taking out the use of RefPtr because we know nothing is done between the call to parentElement and the call to computeCSSPropertyValue is absolutely *not* the theme of our modern code.

Why does the use of RefPtr here not compile? We need to fix that, not remove smart pointers. To move in the direction of more secure code, we need to move to always using smart pointers for local variables.
Comment 7 Fujii Hironori 2021-12-21 02:25:44 PST
Thank you for the feedback. Reopened.
Comment 8 Alex Christensen 2021-12-21 15:07:06 PST
I agree with Darin's feedback.
Comment 9 Fujii Hironori 2021-12-23 13:02:15 PST
I created a repro and reported the bug to MSVC team.
https://developercommunity.visualstudio.com/t/error-c2839-invalid-return-type-t-for-overloaded-o/1620672
Comment 10 Don Olmstead 2021-12-24 19:24:50 PST
Fujii just provide the full templated type here. Look at my WIP patch for the /permissive- to see what got me past this error
Comment 11 Fujii Hironori 2021-12-26 13:06:17 PST
Yup. Your workaround seems the best (attachment 445038 [details]). I just wanted to confirm that this is MSVC bug and let them know before preparing a patch for WebKit.
Comment 12 Fujii Hironori 2022-02-01 13:35:29 PST
Created attachment 450563 [details]
Patch
Comment 13 EWS 2022-02-01 14:49:05 PST
Committed r288913 (246653@main): <https://commits.webkit.org/246653@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 450563 [details].