[Bug c++/93607] New: Deprecated alias templates don't produce warnings

tim.pavlic at minelab dot com.au gcc-bugzilla@gcc.gnu.org
Wed Feb 5 22:14:00 GMT 2020


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

            Bug ID: 93607
           Summary: Deprecated alias templates don't produce warnings
           Product: gcc
           Version: 9.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tim.pavlic at minelab dot com.au
  Target Milestone: ---

Source I'm testing with:
-------------------------

#include <type_traits>

template <typename T>
struct identity
{
    using type = T;
};

template <typename T>
using Identity [[deprecated]] = identity<T>;

void x()
{
    // No deprecated warnings here
    using Int = typename Identity<int>::type;
    static_assert(std::is_same<typename identity<int>::type, typename
Identity<int>::type>::value, "");

    // No deprecated warning
    Int i = 0; 

    // No deprecated warning
    typename Identity<int>::type j = 0; 
}


-----

I would have thought that all (or most) of the scenarios above would have
generated deprecation warnings, but none of them do.
Does the standard say that alias templates are exempt from [[deprecated]]?
I've tried this on godbolt.org with versions of GCC back to 4.9, and none of
them produce warnings.


More information about the Gcc-bugs mailing list