[Webkit-unassigned] [Bug 182081] New: [Win] MSVC doesn't seem to like "friend class NeverDestroyed<Foo>"

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 24 18:27:44 PST 2018


https://bugs.webkit.org/show_bug.cgi?id=182081

            Bug ID: 182081
           Summary: [Win] MSVC doesn't seem to like "friend class
                    NeverDestroyed<Foo>"
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit Misc.
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: Hironori.Fujii at sony.com
                CC: utatane.tea at gmail.com

[Win] MSVC doesn't seem to like "friend class NeverDestroyed<Foo>"

While trying to build WebKit2 for Windows (Bug 181885), I see a lot of compilation errors that NeverDestroyed is not a friend like following:

> 1>------ Build started: Project: WebKit (WebKit\WebKit), Configuration: Debug x64 ------
> 1>NetworkProcess.cpp
> 1>C:\webkit\gb\WebKitBuild\Debug\DerivedSources\ForwardingHeaders\wtf/NeverDestroyed.h(50): error C2248: 'WebKit::NetworkProcess::NetworkProcess': cannot access private member declared in class 'WebKit::NetworkProcess'
> 1>C:\webkit\gb\Source\WebKit\NetworkProcess\NetworkProcess.cpp(104): note: see declaration of 'WebKit::NetworkProcess::NetworkProcess'
> 1>c:\webkit\gb\source\webkit\networkprocess\NetworkProcess.h(79): note: see declaration of 'WebKit::NetworkProcess'
> 1>C:\webkit\gb\Source\WebKit\NetworkProcess\NetworkProcess.cpp(100): note: see reference to function template instantiation 'WTF::NeverDestroyed<WebKit::NetworkProcess>::NeverDestroyed<>(void)' being compiled
> 1>C:\webkit\gb\Source\WebKit\NetworkProcess\NetworkProcess.cpp(100): note: see reference to function template instantiation 'WTF::NeverDestroyed<WebKit::NetworkProcess>::NeverDestroyed<>(void)' being compiled
> 1>Done building project "WebKit.vcxproj" -- FAILED.
> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

If I apply a following patch, it can build:

> diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.h b/Source/WebKit/NetworkProcess/NetworkProcess.h
> index a9c9818dd03..15a7469cb23 100644
> --- a/Source/WebKit/NetworkProcess/NetworkProcess.h
> +++ b/Source/WebKit/NetworkProcess/NetworkProcess.h
> @@ -78,8 +78,8 @@ class Cache;
>  
>  class NetworkProcess : public ChildProcess, private DownloadManager::Client {
>      WTF_MAKE_NONCOPYABLE(NetworkProcess);
> -    friend class NeverDestroyed<NetworkProcess>;
> -    friend class NeverDestroyed<DownloadManager>;
> +    friend NeverDestroyed<NetworkProcess>;
> +    friend NeverDestroyed<DownloadManager>;
>  public:
>      static NetworkProcess& singleton();
>

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180125/b19cbe37/attachment.html>


More information about the webkit-unassigned mailing list