Skip to content
Permalink
Browse files
MSVC reports "SVGPropertyAnimator.h(94): error C2839: invalid return …
…type 'T *' for overloaded 'operator ->'" with /std:c++20

https://bugs.webkit.org/show_bug.cgi?id=234546
<rdar://problem/86757805>

Reviewed by Darin Adler.

r287300 was a wrong fix that used a raw pointer to work around an
MSVC's RefPtr compilation error. We should use smart pointers for
local variables.

This seems a MSVC bug that the class template argument deduction
doesn't work in this case. Explicitly specifying a class template
argument is a workaround.

* svg/properties/SVGPropertyAnimator.h:
(WebCore::SVGPropertyAnimator::computeInheritedCSSPropertyValue const):
Changed the type of the local variable 'parent' from a raw pointer
to RefPtr<Element>.



Canonical link: https://commits.webkit.org/246653@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
fujii committed Feb 1, 2022
1 parent 6cffb62 commit 10f9230ccffd53f89843c085e0d680ecac73285f
Showing 2 changed files with 22 additions and 1 deletion.
@@ -1,3 +1,24 @@
2022-02-01 Fujii Hironori <Hironori.Fujii@sony.com>

MSVC reports "SVGPropertyAnimator.h(94): error C2839: invalid return type 'T *' for overloaded 'operator ->'" with /std:c++20
https://bugs.webkit.org/show_bug.cgi?id=234546
<rdar://problem/86757805>

Reviewed by Darin Adler.

r287300 was a wrong fix that used a raw pointer to work around an
MSVC's RefPtr compilation error. We should use smart pointers for
local variables.

This seems a MSVC bug that the class template argument deduction
doesn't work in this case. Explicitly specifying a class template
argument is a workaround.

* svg/properties/SVGPropertyAnimator.h:
(WebCore::SVGPropertyAnimator::computeInheritedCSSPropertyValue const):
Changed the type of the local variable 'parent' from a raw pointer
to RefPtr<Element>.

2022-02-01 Ryosuke Niwa <rniwa@webkit.org>

Use more AtomString and un-inline code for ScriptElementCachedScriptFetcher and its subclasses
@@ -89,7 +89,7 @@ class SVGPropertyAnimator : public SVGAttributeAnimator {

String computeInheritedCSSPropertyValue(SVGElement& targetElement) const
{
auto* parent = targetElement.parentElement();
RefPtr<Element> parent = targetElement.parentElement();
if (!parent || !parent->isSVGElement())
return emptyString();

0 comments on commit 10f9230

Please sign in to comment.