From 3e5e315036905939b6d682cea0dfdd2115770a18 Mon Sep 17 00:00:00 2001 From: Jonas Karlsson Date: Thu, 24 Nov 2022 11:48:30 +0100 Subject: [PATCH] Support GCC 12 C++20 mode This fix just removes a few templates which is needed since C++20 breaks previously valid code. See https://timsong-cpp.github.io/cppwp/n4861/diff.cpp17.class This is basically what is allowed and not in c++20: template struct A { A(); // error: simple-template-id not allowed for constructor A(int); // OK, injected-class-name used ~A(); // error: simple-template-id not allowed for destructor }; --- physx/source/common/src/CmPreallocatingPool.h | 2 +- .../physxmetadata/core/include/PvdMetaDataExtensions.h | 2 +- .../source/physxmetadata/core/include/PxMetaDataObjects.h | 2 +- .../extensions/include/PxExtensionMetaDataObjects.h | 2 +- .../src/physxmetadata/include/PxVehicleMetaDataObjects.h | 2 +- physx/source/pvd/include/PxPvdObjectModelBaseTypes.h | 8 ++++---- physx/source/pvd/src/PxProfileZoneImpl.h | 2 +- physx/source/pvd/src/PxPvdObjectModelInternalTypes.h | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/physx/source/common/src/CmPreallocatingPool.h b/physx/source/common/src/CmPreallocatingPool.h index c27511d53..f9ea9db94 100644 --- a/physx/source/common/src/CmPreallocatingPool.h +++ b/physx/source/common/src/CmPreallocatingPool.h @@ -393,7 +393,7 @@ template class BufferedPreallocatingPool : public PreallocatingPool { PxArray mDeletedElems; - PX_NOCOPY(BufferedPreallocatingPool) + PX_NOCOPY(BufferedPreallocatingPool) public: BufferedPreallocatingPool(PxU32 maxElements, const char* typeName) : PreallocatingPool(maxElements, typeName) { diff --git a/physx/source/physxmetadata/core/include/PvdMetaDataExtensions.h b/physx/source/physxmetadata/core/include/PvdMetaDataExtensions.h index 4e3499a07..f9e944527 100644 --- a/physx/source/physxmetadata/core/include/PvdMetaDataExtensions.h +++ b/physx/source/physxmetadata/core/include/PvdMetaDataExtensions.h @@ -299,7 +299,7 @@ template struct IsFlagsType > { const PxU32ToName* FlagData; - IsFlagsType > () : FlagData( PxEnumTraits().NameConversion ) {} + IsFlagsType() : FlagData( PxEnumTraits().NameConversion ) {} }; diff --git a/physx/source/physxmetadata/core/include/PxMetaDataObjects.h b/physx/source/physxmetadata/core/include/PxMetaDataObjects.h index 77bbebd18..d91f9dd6d 100644 --- a/physx/source/physxmetadata/core/include/PxMetaDataObjects.h +++ b/physx/source/physxmetadata/core/include/PxMetaDataObjects.h @@ -495,7 +495,7 @@ struct PxPropertyToValueStructMemberMap template<> struct PxPropertyToValueStructMemberMap< PxPropertyInfoName::type##_##prop > \ { \ PxU32 Offset; \ - PxPropertyToValueStructMemberMap< PxPropertyInfoName::type##_##prop >() : Offset( PX_OFFSET_OF_RT( valueStruct, prop ) ) {} \ + PxPropertyToValueStructMemberMap() : Offset( PX_OFFSET_OF_RT( valueStruct, prop ) ) {} \ template void visitProp( TOperator inOperator, valueStruct& inStruct ) { inOperator( inStruct.prop ); } \ }; diff --git a/physx/source/physxmetadata/extensions/include/PxExtensionMetaDataObjects.h b/physx/source/physxmetadata/extensions/include/PxExtensionMetaDataObjects.h index 6218d906b..92b78b68c 100644 --- a/physx/source/physxmetadata/extensions/include/PxExtensionMetaDataObjects.h +++ b/physx/source/physxmetadata/extensions/include/PxExtensionMetaDataObjects.h @@ -56,7 +56,7 @@ struct PxExtensionsPropertyInfoName template<> struct PxPropertyToValueStructMemberMap< PxExtensionsPropertyInfoName::type##_##prop > \ { \ PxU32 Offset; \ - PxPropertyToValueStructMemberMap< PxExtensionsPropertyInfoName::type##_##prop >() : Offset( PX_OFFSET_OF_RT( valueStruct, prop ) ) {} \ + PxPropertyToValueStructMemberMap() : Offset( PX_OFFSET_OF_RT( valueStruct, prop ) ) {} \ template void visitProp( TOperator inOperator, valueStruct& inStruct ) { inOperator( inStruct.prop ); } \ }; diff --git a/physx/source/physxvehicle/src/physxmetadata/include/PxVehicleMetaDataObjects.h b/physx/source/physxvehicle/src/physxmetadata/include/PxVehicleMetaDataObjects.h index 8af6de293..173cc9ee1 100644 --- a/physx/source/physxvehicle/src/physxmetadata/include/PxVehicleMetaDataObjects.h +++ b/physx/source/physxvehicle/src/physxmetadata/include/PxVehicleMetaDataObjects.h @@ -55,7 +55,7 @@ struct PxVehiclePropertyInfoName template<> struct PxPropertyToValueStructMemberMap< PxVehiclePropertyInfoName::type##_##prop > \ { \ PxU32 Offset; \ - PxPropertyToValueStructMemberMap< PxVehiclePropertyInfoName::type##_##prop >() : Offset( PX_OFFSET_OF_RT( valueStruct, prop ) ) {} \ + PxPropertyToValueStructMemberMap() : Offset( PX_OFFSET_OF_RT( valueStruct, prop ) ) {} \ template void visitProp( TOperator inOperator, valueStruct& inStruct ) { inOperator( inStruct.prop ); } \ }; diff --git a/physx/source/pvd/include/PxPvdObjectModelBaseTypes.h b/physx/source/pvd/include/PxPvdObjectModelBaseTypes.h index 6b775914d..0b972ccc0 100644 --- a/physx/source/pvd/include/PxPvdObjectModelBaseTypes.h +++ b/physx/source/pvd/include/PxPvdObjectModelBaseTypes.h @@ -254,7 +254,7 @@ struct PvdDataTypeToNamespacedNameMap struct PvdDataTypeToNamespacedNameMap \ { \ NamespacedName Name; \ - PvdDataTypeToNamespacedNameMap() : Name("physx3", #type) \ + PvdDataTypeToNamespacedNameMap() : Name("physx3", #type) \ { \ } \ }; \ @@ -262,7 +262,7 @@ struct PvdDataTypeToNamespacedNameMap struct PvdDataTypeToNamespacedNameMap \ { \ NamespacedName Name; \ - PvdDataTypeToNamespacedNameMap() : Name("physx3", #type) \ + PvdDataTypeToNamespacedNameMap() : Name("physx3", #type) \ { \ } \ }; @@ -286,7 +286,7 @@ inline NamespacedName getPvdNamespacedNameForType() struct PvdDataTypeToNamespacedNameMap \ { \ NamespacedName Name; \ - PvdDataTypeToNamespacedNameMap() : Name(ns, name) \ + PvdDataTypeToNamespacedNameMap() : Name(ns, name) \ { \ } \ }; @@ -296,7 +296,7 @@ inline NamespacedName getPvdNamespacedNameForType() struct PvdDataTypeToNamespacedNameMap \ { \ NamespacedName Name; \ - PvdDataTypeToNamespacedNameMap() : Name(PvdDataTypeToNamespacedNameMap().Name) \ + PvdDataTypeToNamespacedNameMap() : Name(PvdDataTypeToNamespacedNameMap().Name) \ { \ } \ }; diff --git a/physx/source/pvd/src/PxProfileZoneImpl.h b/physx/source/pvd/src/PxProfileZoneImpl.h index 00527d7f7..8b780c245 100644 --- a/physx/source/pvd/src/PxProfileZoneImpl.h +++ b/physx/source/pvd/src/PxProfileZoneImpl.h @@ -78,7 +78,7 @@ namespace physx { namespace profile { PxProfileArray mZoneClients; volatile bool mEventsActive; - PX_NOCOPY(ZoneImpl) + PX_NOCOPY(ZoneImpl) public: ZoneImpl( PxAllocatorCallback* inAllocator, const char* inName, uint32_t bufferSize = 0x10000 /*64k*/, const TNameProvider& inProvider = TNameProvider() ) : TZoneEventBufferType( inAllocator, bufferSize, PxDefaultContextProvider(), NULL, PxProfileNullEventFilter() ) diff --git a/physx/source/pvd/src/PxPvdObjectModelInternalTypes.h b/physx/source/pvd/src/PxPvdObjectModelInternalTypes.h index 48ba5c30e..ffa9f02a0 100644 --- a/physx/source/pvd/src/PxPvdObjectModelInternalTypes.h +++ b/physx/source/pvd/src/PxPvdObjectModelInternalTypes.h @@ -80,7 +80,7 @@ struct PvdTypeToDataTypeMap struct PvdDataTypeToNamespacedNameMap \ { \ NamespacedName Name; \ - PvdDataTypeToNamespacedNameMap() : Name("physx3_debugger_internal", #type) \ + PvdDataTypeToNamespacedNameMap() : Name("physx3_debugger_internal", #type) \ { \ } \ };