[all-commits] [llvm/llvm-project] c36687: [libc++] Remove deprecated char_traits base templa...

Louis Dionne via All-commits all-commits at lists.llvm.org
Tue Jan 30 05:45:41 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c3668779c13596e223c26fbd49670d18cd638c40
      https://github.com/llvm/llvm-project/commit/c3668779c13596e223c26fbd49670d18cd638c40
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2024-01-30 (Tue, 30 Jan 2024)

  Changed paths:
    M libcxx/docs/ReleaseNotes/19.rst
    M libcxx/include/__string/char_traits.h
    R libcxx/test/libcxx/strings/char.traits/char.traits.specializations/arbitrary_char_type.deprecated.verify.cpp
    R libcxx/test/libcxx/strings/char.traits/char.traits.specializations/arbitrary_char_type.pass.cpp

  Log Message:
  -----------
  [libc++] Remove deprecated char_traits base template (#72694)

This patch has quite a bit of history. First, it must be noted that the
Standard only specifies specializations of char_traits for char,
char8_t, char16_t, char32_t and wchar_t. However, before this patch, we
would provide a base template that accepted anything, and as a result
code like `std::basic_string<long long>` would compile but nobody knows
what it really does. It basically compiles by accident.

We marked the base template as deprecated in LLVM 15 or 16 and were
planning on removing it in LLVM 17, which we did in e30a148b098d.
However, it turned out that the deprecation warning had never been
visible in user code since Clang did not surface that warning from
system headers. As a result, this caught people by surprise and we
decided to reintroduce the base template in LLVM 17 in cce062d226ba.

Since then, #70353 changed Clang so that such deprecation warnings would
be visible from user code. Hence, this patch closes the loop and removes
the deprecated specializations.




More information about the All-commits mailing list