Skip to content

Conversation

@pinwhell
Copy link

GCC 14+ diagnoses a redundant redeclaration of

asio::error::detail::error_number_to_condition(int)

when impl/error_code.ipp is included via error_code.hpp prior to the
public declaration in error.hpp.

Guard the forward declaration so it is emitted only once per
translation unit, while preserving existing inclusion order and
behavior.

No functional or ABI changes.

Fixes #1697.

…edundant-decls

GCC 14+ diagnoses a redundant redeclaration of
asio::error::detail::error_number_to_condition(int) when error_code.ipp is included via error_code.hpp prior to the public declaration in error.hpp.

Introduce a local guard macro to ensure the forward declaration is emitted only once per translation unit, while preserving existing inclusion paths and behavior.

No functional or ABI changes.
Fixes builds using -Wredundant-decls -Werror with GCC 14/15.
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

Successfully merging this pull request may close these issues.

g++14 complains about redundant redeclaration when using redundant-decls parameter

1 participant