File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -538,15 +538,15 @@ extern "C" {
538538//
539539// Example: _Py_TYPEOF(x) x_copy = (x);
540540//
541- // On C23, use typeof(). Otherwise __typeof__() if on GCC, clang or
542- // MSVC 17.9 and newer. Else if on C++11 or newer, decltype() is used .
541+ // On C23, use typeof(). On C++11, use decltype(). Otherwise, use __typeof__()
542+ // if on GCC, clang or MSVC 17.9 and newer .
543543#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
544544# define _Py_TYPEOF (expr ) typeof (expr)
545+ #elif defined(__cplusplus) && __cplusplus >= 201103L
546+ # define _Py_TYPEOF (expr ) decltype (expr)
545547#elif defined(__GNUC__) || defined(__clang__) || \
546548 (defined (_MSC_VER) && _MSC_VER >= 1939 )
547549# define _Py_TYPEOF (expr ) __typeof__(expr)
548- #elif defined(__cplusplus) && __cplusplus >= 201103L
549- # define _Py_TYPEOF (expr ) decltype (expr)
550550#endif
551551
552552
You can’t perform that action at this time.
0 commit comments