higher-performance wrote:

I'm surprised to hear this. It absolutely looks like a bug to me -- the 
`deprecated` attribute applies to the symbol(s) being declared (`f` in that 
example), not to everything inside that declaration, and especially not to 
symbols used inside attributes in the declaration. They are completely 
orthogonal. For example, if we have
```
int foo();
template<class T>
__attribute__((deprecated)) decltype(foo()) bar();
```
then you wouldn't say `foo` is deprecated, right? Or if we have
```
namespace ns {
int foo(const void*);

struct S {
    __attribute__((deprecated))
    friend char foo(S*);
};

template<class T>
__attribute__((deprecated))
auto bar(T& x) -> decltype(foo(&x));
}

int main() {
    ns::S s;
    ns::bar(s);
}

```
then surely users should observe a difference between `foo` being deprecated 
vs. not-deprecated?

I also don't understand the motivation: what is the logic for _not_ telling 
users a symbol that they're using is deprecated? How are they supposed to 
migrate off the symbol if they don't know it's deprecated...?

P.S., there is apparently also an inconsistency here where removing `namespace 
{ }` actually *does* cause this to fire! So even the intended behavior seems to 
have a bug in its implementation, though I'm arguing the intended behavior 
itself is buggy.

https://github.com/llvm/llvm-project/pull/222094
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to