<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>278630</bug_id>
          
          <creation_ts>2024-08-25 14:20:46 -0700</creation_ts>
          <short_desc>Move some WebCore/WebKitLegacy/WebKit destructors to source files for upstream clang</short_desc>
          <delta_ts>2024-08-26 17:18:44 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Kilzer (:ddkilzer)">ddkilzer</reporter>
          <assigned_to name="David Kilzer (:ddkilzer)">ddkilzer</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2055235</commentid>
    <comment_count>0</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2024-08-25 14:20:46 -0700</bug_when>
    <thetext>Move WebCore/WebKitLegacy/WebKit destructors to source files for upstream clang.

Example build errors:

In file included from WebKitBuild/Release/DerivedSources/WebCore/unified-sources/UnifiedSource446.cpp:1:
In file included from Source/WebCore/WebCorePrefix.h:68:
In file included from /usr/include/c++/v1/algorithm:1821:
In file included from /usr/include/c++/v1/__algorithm/inplace_merge.h:28:
/usr/include/c++/v1/__memory/unique_ptr.h:65:19: error: invalid application of &apos;sizeof&apos; to an incomplete type &apos;WebCore::NativeImageBackend&apos;
   65 |     static_assert(sizeof(_Tp) &gt;= 0, &quot;cannot delete an incomplete type&quot;);
      |                   ^~~~~~~~~~~
/usr/include/c++/v1/__memory/unique_ptr.h:278:7: note: in instantiation of member function &apos;std::default_delete&lt;WebCore::NativeImageBackend&gt;::operator()&apos; requested here
  278 |       __ptr_.second()(__tmp);
      |       ^
/usr/include/c++/v1/__memory/unique_ptr.h:248:71: note: in instantiation of member function &apos;std::unique_ptr&lt;WebCore::NativeImageBackend&gt;::reset&apos; requested here
  248 |   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 ~unique_ptr() { reset(); }
      |                                                                       ^
In file included from WebKitBuild/Release/DerivedSources/WebCore/unified-sources/UnifiedSource446.cpp:1:
In file included from Source/WebCore/WebCorePrefix.h:168:
In file included from WebKitBuild/Release/usr/local/include/wtf/text/AtomString.h:24:
In file included from WebKitBuild/Release/usr/local/include/wtf/text/AtomStringImpl.h:23:
In file included from WebKitBuild/Release/usr/local/include/wtf/text/UniquedStringImpl.h:28:
In file included from WebKitBuild/Release/usr/local/include/wtf/text/StringImpl.h:35:
In file included from WebKitBuild/Release/usr/local/include/wtf/Vector.h:40:
In file included from WebKitBuild/Release/usr/local/include/wtf/VectorTraits.h:27:
WebKitBuild/Release/usr/local/include/wtf/UniqueRef.h:57:7: note: in instantiation of member function &apos;std::unique_ptr&lt;WebCore::NativeImageBackend&gt;::~unique_ptr&apos; requested here
   57 | class UniqueRef {
      |       ^
In file included from WebKitBuild/Release/DerivedSources/WebCore/unified-sources/UnifiedSource446.cpp:1:
In file included from Source/WebCore/workers/service/ServiceWorkerGlobalScope.cpp:27:
In file included from Source/WebCore/workers/service/ServiceWorkerGlobalScope.h:34:
In file included from Source/WebCore/workers/service/ServiceWorkerRegistration.h:32:
In file included from Source/WebCore/Modules/notifications/Notification.h:42:
In file included from Source/WebCore/Modules/notifications/NotificationResources.h:28:
In file included from Source/WebCore/platform/graphics/Image.h:38:
Source/WebCore/platform/graphics/NativeImage.h:43:7: note: in implicit destructor for &apos;WTF::UniqueRef&lt;WebCore::NativeImageBackend&gt;&apos; first required here
   43 | class NativeImage final : public RenderingResource {
      |       ^
Source/WebCore/platform/graphics/NativeImage.h:43:7: note: in implicit destructor for &apos;WebCore::NativeImage&apos; first required here
Source/WebCore/platform/graphics/NativeImage.h:41:7: note: forward declaration of &apos;WebCore::NativeImageBackend&apos;
   41 | class NativeImageBackend;
      |       ^
In file included from WebKitBuild/Release/DerivedSources/WebCore/unified-sources/UnifiedSource446.cpp:1:
In file included from Source/WebCore/WebCorePrefix.h:68:
In file included from /usr/include/c++/v1/algorithm:1821:
In file included from /usr/include/c++/v1/__algorithm/inplace_merge.h:28:
/usr/include/c++/v1/__memory/unique_ptr.h:65:19: error: invalid application of &apos;sizeof&apos; to an incomplete type &apos;WebCore::SVGPathByteStream&apos;
   65 |     static_assert(sizeof(_Tp) &gt;= 0, &quot;cannot delete an incomplete type&quot;);
      |                   ^~~~~~~~~~~
/usr/include/c++/v1/__memory/unique_ptr.h:278:7: note: in instantiation of member function &apos;std::default_delete&lt;WebCore::SVGPathByteStream&gt;::operator()&apos; requested here
  278 |       __ptr_.second()(__tmp);
      |       ^
/usr/include/c++/v1/__memory/unique_ptr.h:248:71: note: in instantiation of member function &apos;std::unique_ptr&lt;WebCore::SVGPathByteStream&gt;::reset&apos; requested here
  248 |   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 ~unique_ptr() { reset(); }
      |                                                                       ^
In file included from WebKitBuild/Release/DerivedSources/WebCore/unified-sources/UnifiedSource446.cpp:1:
In file included from Source/WebCore/workers/service/ServiceWorkerGlobalScope.cpp:27:
In file included from Source/WebCore/workers/service/ServiceWorkerGlobalScope.h:35:
In file included from Source/WebCore/workers/WorkerGlobalScope.h:32:
In file included from Source/WebCore/html/ImageBitmap.h:30:
In file included from Source/WebCore/platform/graphics/ImageBuffer.h:31:
In file included from Source/WebCore/platform/graphics/ImageBufferBackend.h:31:
In file included from Source/WebCore/platform/graphics/GraphicsLayerContentsDisplayDelegate.h:28:
In file included from Source/WebCore/platform/graphics/GraphicsLayer.h:56:
In file included from Source/WebCore/platform/animation/AcceleratedEffectStack.h:30:
In file included from Source/WebCore/platform/animation/AcceleratedEffect.h:30:
In file included from Source/WebCore/platform/animation/AcceleratedEffectValues.h:34:
In file included from Source/WebCore/rendering/PathOperation.h:32:
Source/WebCore/rendering/style/BasicShapes.h:309:7: note: in instantiation of member function &apos;std::unique_ptr&lt;WebCore::SVGPathByteStream&gt;::~unique_ptr&apos; requested here
  309 | class BasicShapePath final : public BasicShape {
      |       ^
Source/WebCore/rendering/style/BasicShapes.h:309:7: note: in implicit destructor for &apos;WebCore::BasicShapePath&apos; first required here
Source/WebCore/rendering/style/BasicShapes.h:51:7: note: forward declaration of &apos;WebCore::SVGPathByteStream&apos;
   51 | class SVGPathByteStream;
      |       ^
In file included from WebKitBuild/Release/DerivedSources/WebCore/unified-sources/UnifiedSource446.cpp:1:
In file included from Source/WebCore/WebCorePrefix.h:165:
In file included from WebKitBuild/Release/usr/local/include/wtf/HashMap.h:25:
In file included from WebKitBuild/Release/usr/local/include/wtf/HashTable.h:33:
In file included from WebKitBuild/Release/usr/local/include/wtf/HashTraits.h:26:
In file included from WebKitBuild/Release/usr/local/include/wtf/HashFunctions.h:26:
In file included from WebKitBuild/Release/usr/local/include/wtf/RefPtr.h:28:
WebKitBuild/Release/usr/local/include/wtf/Ref.h:62:16: error: member access into incomplete type &apos;WebCore::GPU&apos;
   62 |             ptr-&gt;deref();
      |                ^
In file included from WebKitBuild/Release/DerivedSources/WebCore/unified-sources/UnifiedSource446.cpp:1:
In file included from Source/WebCore/WebCorePrefix.h:165:
In file included from WebKitBuild/Release/usr/local/include/wtf/HashMap.h:25:
In file included from WebKitBuild/Release/usr/local/include/wtf/HashTable.h:33:
In file included from WebKitBuild/Release/usr/local/include/wtf/HashTraits.h:26:
In file included from WebKitBuild/Release/usr/local/include/wtf/HashFunctions.h:26:
WebKitBuild/Release/usr/local/include/wtf/RefPtr.h:60:47: note: in instantiation of member function &apos;WTF::DefaultRefDerefTraits&lt;WebCore::GPU&gt;::derefIfNotNull&apos; requested here
   60 |     ALWAYS_INLINE ~RefPtr() { RefDerefTraits::derefIfNotNull(PtrTraits::exchange(m_ptr, nullptr)); }
      |                                               ^
In file included from WebKitBuild/Release/DerivedSources/WebCore/unified-sources/UnifiedSource446.cpp:1:
In file included from Source/WebCore/workers/service/ServiceWorkerGlobalScope.cpp:51:
Source/WebCore/page/WorkerNavigator.h:37:7: note: in instantiation of member function &apos;WTF::RefPtr&lt;WebCore::GPU&gt;::~RefPtr&apos; requested here
   37 | class WorkerNavigator final : public NavigatorBase, public Supplementable&lt;WorkerNavigator&gt; {
      |       ^
In file included from WebKitBuild/Release/DerivedSources/WebCore/unified-sources/UnifiedSource446.cpp:1:
In file included from Source/WebCore/workers/service/ServiceWorkerGlobalScope.cpp:51:
In file included from Source/WebCore/page/WorkerNavigator.h:29:
Source/WebCore/page/NavigatorBase.h:38:7: note: forward declaration of &apos;WebCore::GPU&apos;
   38 | class GPU;
      |       ^
3 errors generated.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2055236</commentid>
    <comment_count>1</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2024-08-25 14:21:30 -0700</bug_when>
    <thetext>&lt;rdar://134660411&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2055238</commentid>
    <comment_count>2</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2024-08-25 14:23:51 -0700</bug_when>
    <thetext>*** Bug 278629 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2055239</commentid>
    <comment_count>3</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2024-08-25 14:41:07 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/32688</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2055477</commentid>
    <comment_count>4</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2024-08-26 17:18:44 -0700</bug_when>
    <thetext>Committed 282753@main (b2f4995): https://commits.webkit.org/282753@main

Reviewed commits have been landed. Closing PR #32688 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>