Skip to content

Commit dff959d

Browse files
committed
gh-160436: skip PyStatus.exitcode deprecation on clang++ 21 and older
1 parent 1dd8e71 commit dff959d

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎Include/cpython/initconfig.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ typedef struct {
1515
} _type;
1616
const char *func;
1717
const char *err_msg;
18+
#if defined(__cplusplus) && defined(__clang__) && __clang_major__ < 22
19+
// gh-160436: clang < 22 warns in the implicit copy/move members
20+
int exitcode;
21+
#else
1822
Py_DEPRECATED(3.16) int exitcode;
23+
#endif
1924
} PyStatus;
2025

2126
PyAPI_FUNC(PyStatus) PyStatus_Ok(void);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Fix a spurious ``-Wdeprecated-declarations`` warning when a
2+
:c:type:`PyStatus` is copied in C++ with clang 21 and older:
3+
:c:member:`PyStatus.exitcode` is no longer marked as deprecated for C++ on
4+
those compilers.

0 commit comments

Comments
 (0)