Title: [288913] trunk/Source/WebCore
Revision
288913
Author
[email protected]
Date
2022-02-01 14:47:54 -0800 (Tue, 01 Feb 2022)

Log Message

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>.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (288912 => 288913)


--- trunk/Source/WebCore/ChangeLog	2022-02-01 22:13:05 UTC (rev 288912)
+++ trunk/Source/WebCore/ChangeLog	2022-02-01 22:47:54 UTC (rev 288913)
@@ -1,3 +1,24 @@
+2022-02-01  Fujii Hironori  <[email protected]>
+
+        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  <[email protected]>
 
         Use more AtomString and un-inline code for ScriptElementCachedScriptFetcher and its subclasses

Modified: trunk/Source/WebCore/svg/properties/SVGPropertyAnimator.h (288912 => 288913)


--- trunk/Source/WebCore/svg/properties/SVGPropertyAnimator.h	2022-02-01 22:13:05 UTC (rev 288912)
+++ trunk/Source/WebCore/svg/properties/SVGPropertyAnimator.h	2022-02-01 22:47:54 UTC (rev 288913)
@@ -89,7 +89,7 @@
 
     String computeInheritedCSSPropertyValue(SVGElement& targetElement) const
     {
-        auto* parent = targetElement.parentElement();
+        RefPtr<Element> parent = targetElement.parentElement();
         if (!parent || !parent->isSVGElement())
             return emptyString();
         
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to