RESOLVED FIXED 111579
Fix GCC with C++11 build
https://bugs.webkit.org/show_bug.cgi?id=111579
Summary Fix GCC with C++11 build
Allan Sandfeld Jensen
Reported 2013-03-06 07:36:17 PST
WebCore does not currently build with GCC if C++11 is enabled. The issue is caused by private virtual destructors which are meaningless since private destructors are considered deleted and can not be virtual.
Attachments
Patch (3.80 KB, patch)
2013-03-06 07:38 PST, Allan Sandfeld Jensen
no flags
Patch (3.80 KB, patch)
2013-03-07 02:45 PST, Allan Sandfeld Jensen
no flags
Allan Sandfeld Jensen
Comment 1 2013-03-06 07:38:05 PST
Allan Sandfeld Jensen
Comment 2 2013-03-06 07:43:47 PST
Well, more specifically while virtual destructors can be private, you can not inherit from the class if they are, which causes compile errors in MemoryInstrumentation.
Alexey Proskuryakov
Comment 3 2013-03-06 17:01:33 PST
Comment on attachment 191747 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=191747&action=review > Source/WebCore/ChangeLog:8 > + Private destructors are considered deleted and can not be virtual. This is surprising. Is that a gcc bug?
Anders Carlsson
Comment 4 2013-03-06 19:33:45 PST
What version of GCC is this?
Allan Sandfeld Jensen
Comment 5 2013-03-07 02:36:12 PST
(In reply to comment #3) > (From update of attachment 191747 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=191747&action=review > > > Source/WebCore/ChangeLog:8 > > + Private destructors are considered deleted and can not be virtual. > > This is surprising. Is that a gcc bug? That statement wasn't precise, see comment #2. I think MSVC has the same issue, but can be disabled as a warning. The following hack in MemoryInstrumentation.h, will probably also be fixed by this patch: #pragma warning(disable: 4624) // Disable warning: destructor could not be generated because a base class destructor is inaccessible.
Allan Sandfeld Jensen
Comment 6 2013-03-07 02:45:48 PST
Created attachment 191960 [details] Patch Corrected changelog
Allan Sandfeld Jensen
Comment 7 2013-03-07 02:48:45 PST
(In reply to comment #4) > What version of GCC is this? 4.7
Alexey Proskuryakov
Comment 8 2013-03-07 09:53:18 PST
Sorry for not noticing the comment at first. Anyway, deferring to Anders for review.
Allan Sandfeld Jensen
Comment 9 2013-03-13 04:11:17 PDT
Anders, does this look okay to you?
Anders Carlsson
Comment 10 2013-03-13 13:53:16 PDT
What's the error message again?
Allan Sandfeld Jensen
Comment 11 2013-03-15 06:17:58 PDT
(In reply to comment #10) > What's the error message again? Here is one example: /src/webkit/Source/WTF/wtf/MemoryInstrumentation.h: In instantiation of 'struct WTF::MemoryInstrumentation::IsInstrumented<WebCore::StyleRuleCSSStyleDeclaration>::Base': /src/webkit/Source/WTF/wtf/MemoryInstrumentation.h:148:41: required by substitution of 'template<class U> static WTF::MemoryInstrumentation::IsInstrumented<Type>::no WTF::MemoryInstrumentation::IsInstrumented::deduce(U*, WTF::MemoryInstrumentation::IsInstrumented<Type>::Helper<void (WTF::MemoryInstrumentation::IsInstrumented<Type>::BaseMixin::*)(WTF::MemoryObjectInfo*)const, (& U:: reportMemoryUsage)>*) [with U = U; Type = WebCore::StyleRuleCSSStyleDeclaration] [with U = WTF::MemoryInstrumentation::IsInstrumented<WebCore::StyleRuleCSSStyleDeclaration>::Base]' /src/webkit/Source/WTF/wtf/MemoryInstrumentation.h:152:76: required from 'const bool WTF::MemoryInstrumentation::IsInstrumented<WebCore::StyleRuleCSSStyleDeclaration>::result' /src/webkit/Source/WTF/wtf/MemoryInstrumentation.h:283:5: required from 'void WTF::reportMemoryUsage(const T*, WTF::MemoryObjectInfo*) [with T = WebCore::StyleRuleCSSStyleDeclaration]' /src/webkit/Source/WTF/wtf/MemoryInstrumentation.h:292:9: required from 'void WTF::MemoryInstrumentation::addObjectImpl(const T*, WTF::MemoryObjectInfo*, WTF::MemberType, const char*) [with T = WebCore::StyleRuleCSSStyleDeclaration]' /src/webkit/Source/WTF/wtf/MemoryInstrumentation.h:316:5: required from 'void WTF::MemoryInstrumentation::addObjectImpl(const WTF::RefPtr<T>*, WTF::MemoryObjectInfo*, WTF::MemberType, const char*) [with T = WebCore::StyleRuleCSSStyleDeclaration]' /src/webkit/Source/WTF/wtf/MemoryInstrumentation.h:186:13: required from 'static void WTF::MemoryInstrumentation::MemberTypeTraits<T>::addObject(WTF::MemoryInstrumentation*, const T&, WTF::MemoryObjectInfo*, const char*, WTF::MemberType) [with T = WTF::RefPtr<WebCore::StyleRuleCSSStyleDeclaration>; WTF::MemoryInstrumentation = WTF::MemoryInstrumentation]' /src/webkit/Source/WTF/wtf/MemoryInstrumentation.h:171:9: required from 'void WTF::MemoryInstrumentation::addObject(const T&, WTF::MemoryObjectInfo*, const char*, WTF::MemberType) [with T = WTF::RefPtr<WebCore::StyleRuleCSSStyleDeclaration>]' /src/webkit/Source/WTF/wtf/MemoryInstrumentation.h:245:13: required from 'void WTF::MemoryClassInfo::addMember(const M&, const char*, WTF::MemberType) [with M = WTF::RefPtr<WebCore::StyleRuleCSSStyleDeclaration>]' /src/webkit/Source/WebCore/css/CSSFontFaceRule.cpp:78:70: required from here /src/webkit/Source/WTF/wtf/MemoryInstrumentation.h:141:16: error: deleted function 'virtual WTF::MemoryInstrumentation::IsInstrumented<WebCore::StyleRuleCSSStyleDeclaration>::Base::~Base()' In file included from /src/webkit/Source/WebCore/css/CSSFontFaceRule.cpp:25:0: /src/webkit/Source/WebCore/css/PropertySetCSSStyleDeclaration.h:105:13: error: overriding non-deleted function 'virtual WebCore::StyleRuleCSSStyleDeclaration::~StyleRuleCSSStyleDeclaration()' In file included from /src/webkit/Source/WebCore/platform/PlatformMemoryInstrumentation.h:34:0, from /src/webkit/Source/WebCore/dom/WebCoreMemoryInstrumentation.h:34, from /src/webkit/Source/WebCore/css/CSSRule.h:26, from /src/webkit/Source/WebCore/css/CSSFontFaceRule.h:25, from /src/webkit/Source/WebCore/css/CSSFontFaceRule.cpp:23: /src/webkit/Source/WTF/wtf/MemoryInstrumentation.h:141:16: note: 'virtual WTF::MemoryInstrumentation::IsInstrumented<WebCore::StyleRuleCSSStyleDeclaration>::Base::~Base()' is implicitly deleted because the default definition would be ill-formed: In file included from /src/webkit/Source/WebCore/css/CSSFontFaceRule.cpp:25:0: /src/webkit/Source/WebCore/css/PropertySetCSSStyleDeclaration.h:105:13: error: 'virtual WebCore::StyleRuleCSSStyleDeclaration::~StyleRuleCSSStyleDeclaration()' is private In file included from /src/webkit/Source/WebCore/platform/PlatformMemoryInstrumentation.h:34:0, from /src/webkit/Source/WebCore/dom/WebCoreMemoryInstrumentation.h:34, from /src/webkit/Source/WebCore/css/CSSRule.h:26, from /src/webkit/Source/WebCore/css/CSSFontFaceRule.h:25, from /src/webkit/Source/WebCore/css/CSSFontFaceRule.cpp:23: /src/webkit/Source/WTF/wtf/MemoryInstrumentation.h:141:16: error: within this context
Allan Sandfeld Jensen
Comment 12 2013-03-26 07:01:29 PDT
Anders: Any input on the build error?
Allan Sandfeld Jensen
Comment 13 2013-04-05 09:11:33 PDT
Comment on attachment 191960 [details] Patch Clearing flags on attachment: 191960 Committed r147751: <http://trac.webkit.org/changeset/147751>
Allan Sandfeld Jensen
Comment 14 2013-04-05 09:11:38 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.