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:
Chris Peterson
2022-06-22 04:06:47 +00:00
parent 97a5d913d1
commit a167300068
2 changed files with 4 additions and 4 deletions

View File

@@ -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,

View File

@@ -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>