Bug 1775162 - Fix C++20 build error in BSPPolygon template class definition. r=gfx-reviewers,jrmuizel
gcc -std=c++20 (but not clang -std=c++20) complains about template class definitions that specify the template parameter on the class constructor. In file included from /builds/worker/workspace/obj-build/dist/include/nsDisplayList.h:43, from /builds/worker/workspace/obj-build/dist/include/mozilla/layout/RemoteLayerTreeOwner.h:17, from /builds/worker/workspace/obj-build/dist/include/mozilla/dom/BrowserParent.h:23, from /builds/worker/checkouts/gecko/accessible/ipc/other/RemoteAccessible.cpp:13: /builds/worker/workspace/obj-build/dist/include/mozilla/layers/BSPTree.h:30:18: error: expected ')' before '*' token | BSPPolygon<T>(T* aData, gfx::Polygon&& aGeometry) | ~ ^ Differential Revision: https://phabricator.services.mozilla.com/D149813
This commit is contained in:
@@ -27,7 +27,7 @@ template <typename T>
|
||||
struct BSPPolygon {
|
||||
explicit BSPPolygon(T* aData) : data(aData) {}
|
||||
|
||||
BSPPolygon<T>(T* aData, gfx::Polygon&& aGeometry)
|
||||
BSPPolygon(T* aData, gfx::Polygon&& aGeometry)
|
||||
: data(aData), geometry(Some(std::move(aGeometry))) {}
|
||||
|
||||
BSPPolygon(T* aData, nsTArray<gfx::Point4D>&& aPoints,
|
||||
|
||||
@@ -44,7 +44,7 @@ class TestNodeBase {
|
||||
MOZ_INIT_OUTSIDE_CTOR T mType;
|
||||
|
||||
protected:
|
||||
virtual ~TestNodeBase<T>() = default;
|
||||
virtual ~TestNodeBase() = default;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
@@ -62,7 +62,7 @@ class TestNodeReverse : public TestNodeBase<T> {
|
||||
void SetLastChild(RefPtr<TestNodeReverse<T>> aNode);
|
||||
RefPtr<TestNodeReverse<T>> mSiblingNode;
|
||||
RefPtr<TestNodeReverse<T>> mLastChildNode;
|
||||
~TestNodeReverse<T>() = default;
|
||||
~TestNodeReverse() = default;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
@@ -83,7 +83,7 @@ class TestNodeForward : public TestNodeBase<T> {
|
||||
RefPtr<TestNodeForward<T>> mFirstChildNode = nullptr;
|
||||
// Track last child to facilitate appending children
|
||||
RefPtr<TestNodeForward<T>> mLastChildNode = nullptr;
|
||||
~TestNodeForward<T>() = default;
|
||||
~TestNodeForward() = default;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
|
||||
Reference in New Issue
Block a user