pybind / pybind11

Seamless operability between C++11 and Python
https://pybind11.readthedocs.io/
Other
15.39k stars 2.07k forks source link

clang 17 compatibility fixes #4767

Closed rwgk closed 1 year ago

rwgk commented 1 year ago

Description

Resolve new Clang dev C++11 errors:

The CXX compiler identification is Clang 17.0.0
pytypes.h:1615:23: error: identifier '_s' preceded by whitespace in a literal operator declaration is deprecated [-Werror,-Wdeprecated-literal-operator]
cast.h:1380:26: error: identifier '_a' preceded by whitespace in a literal operator declaration is deprecated [-Werror,-Wdeprecated-literal-operator]

Unfortunately gcc 4.8.5 (released June 23, 2015) has the opposite opinion (hard error):

pytypes.h:1615:12: error: missing space between '""' and suffix identifier

All other compilers are fine either way.

When we drop gcc 4.8.5 support the #ifdef clutter can be removed again.

The only GitHub Actions job using gcc 4.8.5 is: 🐍 3 • centos:7 • x64

Suggested changelog entry:

rwgk commented 1 year ago

Thanks!