Bug 109603 - [GTK] Errors when building WebKit2 with Clang
Summary: [GTK] Errors when building WebKit2 with Clang
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Zan Dobersek
URL:
Keywords:
Depends on:
Blocks: 109314
  Show dependency treegraph
 
Reported: 2013-02-12 12:10 PST by Zan Dobersek
Modified: 2013-02-14 13:41 PST (History)
5 users (show)

See Also:


Attachments
Patch (5.35 KB, patch)
2013-02-13 03:06 PST, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch (5.17 KB, patch)
2013-02-14 12:09 PST, Zan Dobersek
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2013-02-12 12:10:46 PST
[GTK] Errors when building WebKit2 with Clang
Comment 1 Zan Dobersek 2013-02-13 03:06:53 PST
Created attachment 188047 [details]
Patch
Comment 2 Zan Dobersek 2013-02-13 03:09:28 PST
Hi ap -- could you take a look at the patch or point me to another WK2 owner that would be willing to?
Comment 3 WebKit Review Bot 2013-02-13 03:18:23 PST
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 4 Martin Robinson 2013-02-13 05:52:06 PST
Comment on attachment 188047 [details]
Patch

The GTK+ bits looks good to me.
Comment 5 Alexey Proskuryakov 2013-02-13 09:41:14 PST
Comment on attachment 188047 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=188047&action=review

> Source/WebKit2/ChangeLog:13
> +        * UIProcess/Authentication/WebCredential.h: Include the WebCertificateInfo.h and remove the forward declaration. Clang
> +        was throwing build errors because of the incomplete type used in a RefPtr member of the WebCredential class, these
> +        changes fix that.

What were the errors? I think that it's generally fine to use an incomplete type in a RefPtr, and obviously, we successfully build this code with clang on Mac.
Comment 6 Zan Dobersek 2013-02-13 12:49:20 PST
In file included from ../../Source/WebKit2/UIProcess/API/gtk/WebKit2GtkAuthenticationDialog.cpp:21:
In file included from ../../Source/WebKit2/UIProcess/API/gtk/WebKit2GtkAuthenticationDialog.h:23:
In file included from ../../Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.h:30:
In file included from ./DerivedSources/WebKit2/include/WebCore/AuthenticationChallenge.h:1:
In file included from ../../Source/WebCore/platform/network/soup/AuthenticationChallenge.h:28:
In file included from ../../Source/WebCore/platform/network/AuthenticationChallengeBase.h:28:
In file included from ../../Source/WebCore/platform/network/Credential.h:28:
In file included from ../../Source/WTF/wtf/text/WTFString.h:29:
In file included from ../../Source/WTF/wtf/text/StringImpl.h:31:
In file included from ../../Source/WTF/wtf/Vector.h:31:
In file included from ../../Source/WTF/wtf/VectorTraits.h:25:
In file included from ../../Source/WTF/wtf/RefPtr.h:28:
../../Source/WTF/wtf/PassRefPtr.h:53:16: error: member access into incomplete type 'WebKit::WebCertificateInfo'
            ptr->deref();
               ^
../../Source/WTF/wtf/RefPtr.h:56:35: note: in instantiation of function template specialization
      'WTF::derefIfNotNull<WebKit::WebCertificateInfo>' requested here
        ALWAYS_INLINE ~RefPtr() { derefIfNotNull(m_ptr); }
                                  ^
../../Source/WebKit2/UIProcess/Authentication/WebCredential.h:40:7: note: in instantiation of member function
      'WTF::RefPtr<WebKit::WebCertificateInfo>::~RefPtr' requested here
class WebCredential : public APIObject {
      ^
../../Source/WebKit2/UIProcess/Authentication/WebCredential.h:38:7: note: forward declaration of 'WebKit::WebCertificateInfo'
class WebCertificateInfo;
      ^
1 error generated.

Using Clang 3.0 with libstdc++.
Comment 7 Alexey Proskuryakov 2013-02-13 13:40:46 PST
I think that the right fix for that would be to have a non-generated destructor in the class, and to implement it in a .cpp file.
Comment 8 Zan Dobersek 2013-02-14 12:09:43 PST
Created attachment 188397 [details]
Patch
Comment 9 Zan Dobersek 2013-02-14 13:41:08 PST
Comment on attachment 188397 [details]
Patch

Thanks!
Comment 10 Zan Dobersek 2013-02-14 13:41:45 PST
Comment on attachment 188397 [details]
Patch

Clearing flags on attachment: 188397

Committed r142908: <http://trac.webkit.org/changeset/142908>
Comment 11 Zan Dobersek 2013-02-14 13:41:50 PST
All reviewed patches have been landed.  Closing bug.