https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122442
Bug ID: 122442
Summary: [enhancement] namespace control for
-Werror=deprecated-declarations
Product: gcc
Version: 15.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: avi at scylladb dot com
Target Milestone: ---
The [[deprecated("reason")]] allows a library author to deprecate names it
exports.
-Wdeprecated-declarations allows a library author to tolerate deprecated
declarations it imports.
-Werror=deprecated-declarations allows a library author to assert that the
library does not use its own deprecated names, except that it conflicts with
=Wdeprecated-declarations for imported names.
A library author would like fine-grained control over which namespaces cause a
warning, and which cause an error. This would allow the compiler that the
library does not use its own deprecated symbols, but still tolerates deprecated
symbols from the environment, over which it has no control. Where the library
uses its own symbols intentionally (for example, in tests), the author would
sprinkle pragmas to suppress these errors.
Possible syntax: -Werror=deprecated-declarations-namespace-n1-n2 to error for
deprecated symbols from namespace n1::n2.