Skip to content

Fix a C++20 compatibility issue with an unnamed struct (P1766R1)#47

Closed
ClaudioHoffmann wants to merge 1 commit intoMeVisLab:masterfrom
dev-threads:master
Closed

Fix a C++20 compatibility issue with an unnamed struct (P1766R1)#47
ClaudioHoffmann wants to merge 1 commit intoMeVisLab:masterfrom
dev-threads:master

Conversation

@ClaudioHoffmann
Copy link
Copy Markdown

As a result of P1766R1, 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; see https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5208.

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
@usiems
Copy link
Copy Markdown
Contributor

usiems commented Jun 23, 2021

Thank you for your patch. We decided to drop the typedef altogether, so your patch is obsolete now.

@usiems usiems closed this Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants