Title: [260431] trunk/Source/WTF
- Revision
- 260431
- Author
- [email protected]
- Date
- 2020-04-21 09:21:31 -0700 (Tue, 21 Apr 2020)
Log Message
[Clang 10] Fix warning: definition of implicit copy assignment operator for 'PageBlock' is deprecated because it has a user-declared copy constructor
https://bugs.webkit.org/show_bug.cgi?id=210748
Reviewed by Adrian Perez de Castro.
Recent Clang's will issue a warning if you declare an explicit
copy construction, but leave the compiler to fill in an implicit
assignment operator. I think this is to catch cases where you do
something exciting in an assignment operator/copy constructor and
forget to do the same exciting thing in the other.
* wtf/PageAllocation.h: Import the base's constructor to avoid
defining our own identical one.
* wtf/PageBlock.h: Remove trivial constructor and replace with
member initializers. Remove copy constructor. This looks identical
to what the compiler would generate anyway.
Modified Paths
Diff
Modified: trunk/Source/WTF/ChangeLog (260430 => 260431)
--- trunk/Source/WTF/ChangeLog 2020-04-21 16:12:38 UTC (rev 260430)
+++ trunk/Source/WTF/ChangeLog 2020-04-21 16:21:31 UTC (rev 260431)
@@ -1,3 +1,22 @@
+2020-04-21 Charlie Turner <[email protected]>
+
+ [Clang 10] Fix warning: definition of implicit copy assignment operator for 'PageBlock' is deprecated because it has a user-declared copy constructor
+ https://bugs.webkit.org/show_bug.cgi?id=210748
+
+ Reviewed by Adrian Perez de Castro.
+
+ Recent Clang's will issue a warning if you declare an explicit
+ copy construction, but leave the compiler to fill in an implicit
+ assignment operator. I think this is to catch cases where you do
+ something exciting in an assignment operator/copy constructor and
+ forget to do the same exciting thing in the other.
+
+ * wtf/PageAllocation.h: Import the base's constructor to avoid
+ defining our own identical one.
+ * wtf/PageBlock.h: Remove trivial constructor and replace with
+ member initializers. Remove copy constructor. This looks identical
+ to what the compiler would generate anyway.
+
2020-04-21 Claudio Saavedra <[email protected]>
[GTK4] Adapt to GtkIconTheme API changes
Modified: trunk/Source/WTF/wtf/PageAllocation.h (260430 => 260431)
--- trunk/Source/WTF/wtf/PageAllocation.h 2020-04-21 16:12:38 UTC (rev 260430)
+++ trunk/Source/WTF/wtf/PageAllocation.h 2020-04-21 16:21:31 UTC (rev 260431)
@@ -69,10 +69,7 @@
class PageAllocation : private PageBlock {
public:
- PageAllocation()
- {
- }
-
+ using PageBlock::PageBlock;
using PageBlock::size;
using PageBlock::base;
Modified: trunk/Source/WTF/wtf/PageBlock.h (260430 => 260431)
--- trunk/Source/WTF/wtf/PageBlock.h 2020-04-21 16:12:38 UTC (rev 260430)
+++ trunk/Source/WTF/wtf/PageBlock.h 2020-04-21 16:21:31 UTC (rev 260431)
@@ -66,8 +66,7 @@
class PageBlock {
WTF_MAKE_FAST_ALLOCATED;
public:
- PageBlock();
- PageBlock(const PageBlock&);
+ PageBlock() = default;
PageBlock(void*, size_t, bool hasGuardPages);
void* base() const { return m_base; }
@@ -82,25 +81,11 @@
}
private:
- void* m_realBase;
- void* m_base;
- size_t m_size;
+ void* m_realBase { nullptr };
+ void* m_base { nullptr };
+ size_t m_size { 0 };
};
-inline PageBlock::PageBlock()
- : m_realBase(0)
- , m_base(0)
- , m_size(0)
-{
-}
-
-inline PageBlock::PageBlock(const PageBlock& other)
- : m_realBase(other.m_realBase)
- , m_base(other.m_base)
- , m_size(other.m_size)
-{
-}
-
inline PageBlock::PageBlock(void* base, size_t size, bool hasGuardPages)
: m_realBase(base)
, m_base(static_cast<char*>(base) + ((base && hasGuardPages) ? pageSize() : 0))
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes