[llvm-bugs] [Bug 31297] New: [[deprecated]] warning doesn't work on templates

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Dec 6 10:53:43 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=31297

            Bug ID: 31297
           Summary: [[deprecated]] warning doesn't work on templates
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++14
          Assignee: unassignedclangbugs at nondot.org
          Reporter: erich.keane at intel.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

So, the following code will only emit a 2 warnings (1st and 3rd), rather than
all 3:

struct [[deprecated]] no_template{}; 
template<typename T>
struct [[deprecated]] with_template{};
template<>
struct [[deprecated]] with_template<float>{};

int main()
{
  no_template x1; // Warns appropriately
  with_template<int> x2; // Does NOT warn!
  with_template<float> x3; // Warns appropriately
}

Note that the specialization isn't necessary to suppress the 2nd warning.  I
briefly have been attempting to debug this, and don't really see any attempts
to make it work for the template situation.  So, I have 2 questions:

1- Is this done intentionally for standards compliance?  I don't see any reason
why a template function SHOULDN'T accept deprecated.
2- If this is something we want, can anyone provide guidance as to where I can
start to implement this?  I don't mind taking it, I just don't really have a
good idea where to start.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20161206/fc05aeba/attachment.html>


More information about the llvm-bugs mailing list