Fix C++20 build error in BSPPolygon template class definition
Categories
(Core :: Graphics: Layers, defect, P3)
Tracking
()
People
(Reporter: cpeterson, Assigned: cpeterson)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
gcc -std=c++20 (but not clang -std=c++20) complains about template class definitions that specify the template parameter on the class constructor. For example:
template <typename T>
class C {
C(int x) {}
// OK in clang and gcc for both -std=c++17 and -std=c++20.
C<T>(int x, int y) {}
// OK in clang for both -std=c++17 and -std=c++20.
// OK in gcc -std=c++17 but a build error with -std=c++20.
};
The BSPPolygon build error:
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)
| ~ ^
Assignee | ||
Comment 1•2 years ago
|
||
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)
| ~ ^
Pushed by cpeterson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ed6630bb5d50 Fix C++20 build error in BSPPolygon template class definition. r=gfx-reviewers,jrmuizel
Description
•