boostorg / core

Boost Core Utilities
132 stars 86 forks source link

boost::span generates a compiler warning due to redundant redeclaration #151

Closed hadrielk closed 2 months ago

hadrielk commented 11 months ago

When compiling span.hpp, gcc 7.3 gives me this warning:

error: redundant redeclaration of 'constexpr' static data member 'boost::span<T, E>::extent' [-Werror=deprecated]

Because it's a static constexpr defined within the class, and then outside of it later in the file (as if for non-constexpr statics).

pdimov commented 11 months ago

That's odd because gcc 7.3 defaults to C++14 and the deprecation is C++17 if I'm not mistaken.

hadrielk commented 11 months ago

sorry, yes I'm compiling with -std=c++17 - I should have mentioned that.

pdimov commented 11 months ago

Sounds like a variation of https://github.com/boostorg/system/pull/49 is in order. Would you be willing to submit a PR?

hadrielk commented 11 months ago

Would you be willing to submit a PR?

Sure. I'll submit one later this week.

glenfe commented 2 months ago

Addressed in 04cc766db315c9b573fa96aaa214c8acd8a16d64