[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

Mark de Wever via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 19 04:50:14 PDT 2024


================
@@ -1227,12 +1227,11 @@ <h2 id="cxx14">C++14 implementation status</h2>
 </table>
 
 <p>
-<span id="n3778">(7): In Clang 3.7 and later, sized deallocation is only enabled
-if the user passes the <code>-fsized-deallocation</code> flag. The user must
-supply definitions of the sized deallocation functions, either by providing them
-explicitly or by using a C++ standard library that does. <code>libstdc++</code>
-added these functions in version 5.0, and <code>libc++</code> added them in
-version 3.7.
+<span id="n3778">(7): The user must supply definitions of the sized deallocation
+  functions, either by providing them explicitly or by using a C++ standard library
+  that does. <code>libstdc++</code> added these functions in version 5.0, and
+  <code>libc++</code> added them in version 3.7. The user can also use the
+  <code>-fno-sized-deallocation</code> option to disable sized deallocation.
----------------
mordante wrote:

I'm not entirely sure what the question is. If the question is do we allow users to provide their own definition of the sized allocation function, then the answer is yes. http://eel.is/c++draft/replacement.functions.

I'm not sure whether we still need to mention the versions of libc++ and libstdc++; I expect when people use Clang 19 they have a somewhat recent std lib. (Especially since building Clang requires C++17.)

https://github.com/llvm/llvm-project/pull/83774


More information about the cfe-commits mailing list