Title: [287269] trunk/Source/WebKitLegacy/win
Revision
287269
Author
hironori.fu...@sony.com
Date
2021-12-20 11:58:28 -0800 (Mon, 20 Dec 2021)

Log Message

[Win] MSVC reports "COMVariantSetter.h(133): error C2760: syntax error: unexpected token 'identifier', expected ';'" with /std:c++20
https://bugs.webkit.org/show_bug.cgi?id=234501

Reviewed by Don Olmstead.

> Source\WebKitLegacy\win\COMVariantSetter.h(133): error C2760: syntax error: unexpected token 'identifier', expected ';'
> Source\WebKitLegacy\win\COMVariantSetter.h(140): note: see reference to class template instantiation 'COMVariantSetter<WTF::Vector<T,0,WTF::CrashOnOverflow,16,WTF::VectorMalloc>>' being compiled

COMVariant should be used after defined.

* COMVariantSetter.h:
(COMVariantSetter<Vector<T>>): Moved after the COMVariant
definition.

Modified Paths

Diff

Modified: trunk/Source/WebKitLegacy/win/COMVariantSetter.h (287268 => 287269)


--- trunk/Source/WebKitLegacy/win/COMVariantSetter.h	2021-12-20 19:54:43 UTC (rev 287268)
+++ trunk/Source/WebKitLegacy/win/COMVariantSetter.h	2021-12-20 19:58:28 UTC (rev 287269)
@@ -121,24 +121,6 @@
     }
 };
 
-template<typename T> struct COMVariantSetter<Vector<T>> : COMVariantSetterBase<Vector<T>> {
-    static const VARTYPE VariantType = VT_ARRAY | COMVariantSetter<T>::VariantType;
-
-    static void setVariant(VARIANT* variant, const Vector<T>& value)
-    {
-        ASSERT(V_VT(variant) == VT_EMPTY);
-
-        SAFEARRAY* safeArray = ::SafeArrayCreateVector(COMVariantSetter<T>::VariantType, 0, value.size());
-        for (LONG i = 0; i < value.size(); ++i) {
-            COMVariant item(value[i]);
-            ::SafeArrayPutElement(safeArray, &i, &item);
-        }
-
-        V_VT(variant) = VariantType;
-        V_ARRAY(variant) = safeArray;
-    }
-};
-
 template<typename COMType, typename UnderlyingType>
 struct COMIUnknownVariantSetter : COMVariantSetterBase<UnderlyingType>
 {
@@ -220,4 +202,22 @@
     }
 };
 
+template<typename T> struct COMVariantSetter<Vector<T>> : COMVariantSetterBase<Vector<T>> {
+    static const VARTYPE VariantType = VT_ARRAY | COMVariantSetter<T>::VariantType;
+
+    static void setVariant(VARIANT* variant, const Vector<T>& value)
+    {
+        ASSERT(V_VT(variant) == VT_EMPTY);
+
+        SAFEARRAY* safeArray = ::SafeArrayCreateVector(COMVariantSetter<T>::VariantType, 0, value.size());
+        for (LONG i = 0; i < value.size(); ++i) {
+            COMVariant item(value[i]);
+            ::SafeArrayPutElement(safeArray, &i, &item);
+        }
+
+        V_VT(variant) = VariantType;
+        V_ARRAY(variant) = safeArray;
+    }
+};
+
 #endif // COMVariantSetter

Modified: trunk/Source/WebKitLegacy/win/ChangeLog (287268 => 287269)


--- trunk/Source/WebKitLegacy/win/ChangeLog	2021-12-20 19:54:43 UTC (rev 287268)
+++ trunk/Source/WebKitLegacy/win/ChangeLog	2021-12-20 19:58:28 UTC (rev 287269)
@@ -1,3 +1,19 @@
+2021-12-20  Fujii Hironori  <hironori.fu...@sony.com>
+
+        [Win] MSVC reports "COMVariantSetter.h(133): error C2760: syntax error: unexpected token 'identifier', expected ';'" with /std:c++20
+        https://bugs.webkit.org/show_bug.cgi?id=234501
+
+        Reviewed by Don Olmstead.
+
+        > Source\WebKitLegacy\win\COMVariantSetter.h(133): error C2760: syntax error: unexpected token 'identifier', expected ';'
+        > Source\WebKitLegacy\win\COMVariantSetter.h(140): note: see reference to class template instantiation 'COMVariantSetter<WTF::Vector<T,0,WTF::CrashOnOverflow,16,WTF::VectorMalloc>>' being compiled
+
+        COMVariant should be used after defined.
+
+        * COMVariantSetter.h:
+        (COMVariantSetter<Vector<T>>): Moved after the COMVariant
+        definition.
+
 2021-12-19  Wenson Hsieh  <wenson_hs...@apple.com>
 
         Add client layer plumbing for classifying modal container controls
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to