Details
-
Task
-
Resolution: Done
-
P0: Blocker
-
None
-
GCC 12.2
-
c45929079c (qt/qtquick3dphysics/dev) 17b6625229 (qt/qtquick3dphysics/6.4)
Description
Currently, the build fails with OpenSUSE Tumbleweed and gcc (SUSE Linux) 12.2.1 20220830:
Qt6.4/qtquick3dphysics/src/3rdparty/PhysX/source/physx/src/NpAggregate.cpp In file included from /home/USERNAME/Qt6.4/qtquick3dphysics/src/3rdparty/PhysX/pxshared/include/foundation/PxSimpleTypes.h:40, from /home/USERNAME/Qt6.4/qtquick3dphysics/src/3rdparty/PhysX/pxshared/include/foundation/Px.h:37, from /home/USERNAME/Qt6.4/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/Ps.h:35, from /home/USERNAME/Qt6.4/qtquick3dphysics/src/3rdparty/PhysX/source/common/src/CmPhysXCommon.h:36, from /home/USERNAME/Qt6.4/qtquick3dphysics/src/3rdparty/PhysX/source/physx/src/NpAggregate.h:34, from /home/USERNAME/Qt6.4/qtquick3dphysics/src/3rdparty/PhysX/source/physx/src/NpAggregate.cpp:31: /home/USERNAME/Qt6.4/qtquick3dphysics/src/3rdparty/PhysX/pxshared/include/foundation/PxPreprocessor.h:499:15: error: expected unqualified-id before 'const' 499 | Class(const Class&); \ | ^~~~~ /home/USERNAME/Qt6.4/qtquick3dphysics/src/3rdparty/PhysX/source/common/src/CmPreallocatingPool.h:399:9: note: in expansion of macro 'PX_NOCOPY' 399 | PX_NOCOPY(BufferedPreallocatingPool<T>) | ^~~~~~~~~
Looks like an upstream issue. The following code is a simplification of the real PhysX code, but it compiles fine on older versions of GCC.
#include <iostream> #define PX_NOCOPY(Class) \ protected: \ Class(const Class&); \ Class& operator=(const Class&); template<class T> class BufferedPreallocatingPool { private: T m_var; PX_NOCOPY(BufferedPreallocatingPool<T>) public: BufferedPreallocatingPool() : m_var{} { std::cout << "Allocated " << m_var << std::endl; } }; int main() { BufferedPreallocatingPool<int> x; }
Attachments
For Gerrit Dashboard: QTBUG-107547 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
444313,6 | Force c++ version 17 when compiling PhysX | dev | qt/qtquick3dphysics | Status: ABANDONED | -1 | 0 |
445034,2 | Fix PX_NOCOPY use with GCC12/C++20 | dev | qt/qtquick3dphysics | Status: ABANDONED | -1 | 0 |
445098,2 | Support GCC 12 C++20 mode | dev | qt/qtquick3dphysics | Status: MERGED | +2 | 0 |
445142,2 | Support GCC 12 C++20 mode | 6.4 | qt/qtquick3dphysics | Status: MERGED | +2 | 0 |