From a7e4804e52899ddb797c1662faf61a45e5c3474f Mon Sep 17 00:00:00 2001 From: Matthew Woehlke Date: Sat, 7 Oct 2023 19:45:06 -0400 Subject: [PATCH] Fix build for C++20 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove template argument list from constructor names. It has never been necessary, and is forbidden in C++20 (n.b. CWG 2237¹). This has also been independently fixed upstream in r449². Fixes #10952. ¹ https://cplusplus.github.io/CWG/issues/2237.html ² https://sourceforge.net/p/cxx/code/449/ --- src/CXX/Python3/Objects.hxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/CXX/Python3/Objects.hxx b/src/CXX/Python3/Objects.hxx index f00659d8cc..4894ba9c28 100644 --- a/src/CXX/Python3/Objects.hxx +++ b/src/CXX/Python3/Objects.hxx @@ -1321,19 +1321,19 @@ namespace Py return PySequence_Length( ptr() ); } - explicit SeqBase() + explicit SeqBase() :Object( PyTuple_New( 0 ), true ) { validate(); } - explicit SeqBase( PyObject *pyob, bool owned=false ) + explicit SeqBase( PyObject *pyob, bool owned=false ) : Object( pyob, owned ) { validate(); } - SeqBase( const Object &ob ) + SeqBase( const Object &ob ) : Object( ob ) { validate(); @@ -2583,20 +2583,20 @@ namespace Py T the_item; public: - mapref( MapBase &map, const std::string &k ) + mapref( MapBase &map, const std::string &k ) : s( map ), the_item() { key = String( k ); if( map.hasKey( key ) ) the_item = map.getItem( key ); } - mapref( MapBase &map, const Object &k ) + mapref( MapBase &map, const Object &k ) : s( map ), key( k ), the_item() { if( map.hasKey( key ) ) the_item = map.getItem( key ); } - virtual ~mapref() + virtual ~mapref() {} // MapBase stuff @@ -2756,7 +2756,7 @@ namespace Py class MapBase: public Object { protected: - explicit MapBase() + explicit MapBase() {} public: // reference: proxy class for implementing [] @@ -2773,14 +2773,14 @@ namespace Py typedef std::pair< const T, mapref > pointer; // Constructor - explicit MapBase( PyObject *pyob, bool owned = false ) + explicit MapBase( PyObject *pyob, bool owned = false ) : Object( pyob, owned ) { validate(); } // TMM: 02Jul'01 - changed MapBase to Object in next line - MapBase( const Object &ob ) + MapBase( const Object &ob ) : Object( ob ) { validate();