Open Quuxplusone opened 11 years ago
Bugzilla Link | PR17862 |
Status | NEW |
Importance | P enhancement |
Reported by | agenda2010@grueninger.de |
Reported on | 2013-11-09 03:53:08 -0800 |
Last modified on | 2021-10-18 14:38:03 -0700 |
Version | trunk |
Hardware | PC Linux |
CC | dgregor@apple.com, llvm-bugs@lists.llvm.org, pipping@exherbo.org, vsna7ma4he@jorrit.de |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
To state the problem more precisely, the deprecation message is only missing
when templates are not specified.
template <class T>
struct NewClassName
{
// ...
};
template <class T> using OldClassNameUsing __attribute__ ((deprecated))
= NewClassName<T>;
using OldClassNameWithoutTemplateUsing __attribute__ ((deprecated))
= NewClassName<int>;
typedef NewClassName<int> OldClassNameTypedef __attribute__ ((deprecated));
int main()
{
OldClassNameUsing<int> objectUsing; // no deprecation warning
OldClassNameWithoutTemplateUsing objectWithoutTemplateUsing; // emits warning
OldClassNameTypedef objectTypedef; // emits warning
return 0;
}
This has bitten us again: https://gitlab.dune-project.org/core/dune-
common/merge_requests/464#note_41116
All versions of clang up to 5.0 seem to be affected according to godbolt:
https://godbolt.org/g/Cpsbd7
godbolt does not support clang 6 at the moment, so I can't easily test that.
All forms of deprecating seem to be affected: [[deprecated(msg)]],
__attribute__((__deprecated__(msg))), __attribute__((deprecated(msg)))
Still an issue with Clang 13.