Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings emitted by -Wdeprecated-redundant-constexpr-static-def #7794

Open
giesmininkas opened this issue Nov 12, 2024 · 0 comments
Open

Warnings emitted by -Wdeprecated-redundant-constexpr-static-def #7794

giesmininkas opened this issue Nov 12, 2024 · 0 comments

Comments

@giesmininkas
Copy link

Please provide the following information

libtorrent version (or branch): 2.0.10
platform/architecture: x86_64 GNU/Linux
compiler and compiler version: clang-19 w/ libc++-19

Clang check -Wdeprecated-redundant-constexpr-static-def, when compiling in C++17 or greater, emits many warnings, such as:

libtorrent-src/src/alert.cpp:72:36: warning: out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated [-Wdeprecated-redundant-constexpr-static-def]
   72 |         constexpr alert_category_t alert::error_notification;
      |                                           ^

The warnings could be easily silenced by checking the __cplusplus preprocessor macro:

#if __cplusplus < 201703L
// define constexpr static data members
#endif

I can submit a patch if needed.

Thank you!

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

No branches or pull requests

1 participant