Skip to content

Commit 5a253b6

Browse files
Fix a C++20 compatibility issue with an unnamed struct (P1766R1)
As a result of P1766R1 [1], `PyHeapTypeObject` can no longer be added to an unnamed `typedef struct`. On Visual Studio 2019 ≥16.6, this causes the warning C5208 in C++14 and C++17 mode, and the error C7626 with `/std:c++latest` or the future `/std:c++20`. Giving a name to the unnamed struct is the simplest fix here [2]. [1]: http://wg21.link/p1766r1 [2]: https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5208
1 parent 58ccd53 commit 5a253b6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/PythonQtClassWrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ struct PythonQtDynamicClassInfo;
6363
//! a Python wrapper object for PythonQt wrapped classes
6464
//! which inherits from the Python type object to allow
6565
//! deriving of wrapped CPP classes from Python.
66-
typedef struct {
66+
typedef struct PythonQtClassWrapperStruct {
6767
PyHeapTypeObject _base;
6868

6969
//! the additional class information that PythonQt stores for the CPP class

0 commit comments

Comments
 (0)