This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/33911] attribute deprecated vs. templates


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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|NEW                         |RESOLVED
      Known to work|                            |8.0
         Resolution|---                         |FIXED

--- Comment #20 from Martin Sebor <msebor at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #16)

Although Clang doesn't, warning for uses of a deprecated primary seems
correct/useful to me because there's no way to define a specialization of the
primary that's not deprecated.  In your test case, there is no specialization
of  b() that would not use some specialization of the primary class template,
and since every specialization is a use of the primary, that would not be
subject to its deprecated attribute.  (It seems analogous to warning for an
unused constexpr function that can never be used in a core constant
expression.)

I've compiled all the test cases in this bug and, modulo bug(s) that are
already being tracked elsewhere, they all result in the expected warnings. 
With that I'm going to resolve this bug as fixed.

If you feel it's important to only warn for code that's instantiated, rather
than reopening this bug I suggest opening a separate bug just for that.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]