<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Bogus warnings: warning: 'allocator<void>' is deprecated"
   href="https://bugs.llvm.org/show_bug.cgi?id=50299">50299</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Bogus warnings: warning: 'allocator<void>' is deprecated
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>11.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>zilla@kayari.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com, mcypark@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>#include <memory>

int main()
{
  std::allocator<void> a;
}


alloc.C:5:8: warning: 'allocator<void>' is deprecated
[-Wdeprecated-declarations]
  std::allocator<void> a;
       ^
/usr/bin/../include/c++/v1/memory:725:28: note: 'allocator<void>' has been
explicitly marked deprecated here
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 allocator<void>
                           ^
/usr/bin/../include/c++/v1/__config:1035:39: note: expanded from macro
'_LIBCPP_DEPRECATED_IN_CXX17'
#  define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
                                      ^
/usr/bin/../include/c++/v1/__config:1012:48: note: expanded from macro
'_LIBCPP_DEPRECATED'
#    define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
                                               ^


This warning is misleading and unhelpful. It's true that the explicit
specialization is deprecated in C++17 and gone in C++20, but that doesn't mean
users can't use std::allocator<void> in C++20. It just means that doing so uses
the primary template.

It's perfectly fine to use std::allocator<void> in C++17 in limited ways (e.g.
you can't use it to allocate, obviously) and it's perfectly fine to use it in
the same ways in C++20. Telling users it's deprecated is totally unhelpful,
because they don't need to stop using it, but they can't do anything about the
warnings except to stop using it.

What purpose do the warnings serve? What do you expect users to do if they get
that warning? Why should they change their code, when there's nothing wrong
with it?

Please revert the additions of the deprecated attributes here.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>