https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33911

--- Comment #13 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Also, even after the template definition (and the attribute) have been
instantiated, typedefs for the instantiation don't get a warning unless the
typedef itself is also marked deprecated:

template<typename T> struct S {} __attribute__((deprecated));
using Si = S<int>;
using Sd __attribute__((deprecated)) = S<int>;
S<int> s1; // no warning
S<int> s2; // warning, deprecated
Si s3; // no warning
Sd s4; // warning, deprecated

This means that users with a typedef for std::auto_ptr<int> will never get the
warning, because libstdc++ can only add the attribute to the primary template,
not to users' own typedefs.

This matters more now because WG21 just voted to remove auto_ptr from C++17 so
we really want the deprecated attributes in libstdc++ to issue warnings.

Reply via email to