Support attribute deprecated for template alias (original) (raw)
| Bugzilla Link | 17862 |
|---|---|
| Version | trunk |
| OS | Linux |
| CC | @DougGregor |
Extended Description
I want to rename a templated class. To make the transition easier for the users, I'd like to keep the old class for one more version and mark it deprecated with the extensions from GCC / Clang (attribute deprecated). To avoid keeping an exact copy of the deprecated class, the use of template alias would be handy. Unfortunately Clang (3.3 and recent trunk) does not emit a warning (GCC does) for the following code in line 14:
template struct NewClassName { // ... };
template using OldClassNameUsing attribute ((deprecated)) = NewClassName;
typedef NewClassName OldClassNameTypedef attribute ((deprecated));
int main() { OldClassNameUsing objectUsing; OldClassNameTypedef objectTypedef;
return 0; }
Clang used:
clang version 3.4 (194323)
Target: x86_64-unknown-linux-gnu
Thread model: posix