https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128072
Bug ID: 128072
Summary: __attribute__((copy)) copies
__attribute__((deprecated)) if a message is present
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: rl.alt.accnt at gmail dot com
Target Milestone: ---
Consider (https://godbolt.org/z/4oodc5ssc):
```
__attribute__((deprecated)) void dep() {}
__attribute__((deprecated("message"))) void dep_message() {}
__attribute__((copy(dep))) void copy() {}
__attribute__((copy(dep_message))) void copy_message() {}
void f() {
copy(); // No warning
copy_message(); // Warns
}
```
In 'f()', GCC warns about 'copy_message()' being deprecated, but not 'copy()'.
This seems to be a bug as the documentation for '__attribute__((copy))' states
that '__attribute__((deprecated))' is supposed to be excluded from copying
(https://gcc.gnu.org/onlinedocs/gcc/Common-Attributes.html).