| 1 |
.. title:: clang-tidy - cert-mem57-cpp |
| 2 |
|
| 3 |
cert-mem57-cpp |
| 4 |
============== |
| 5 |
|
| 6 |
This check flags uses of default ``operator new`` where the type has extended |
| 7 |
alignment (an alignment greater than the fundamental alignment). (The default |
| 8 |
``operator new`` is guaranteed to provide the correct alignment if the |
| 9 |
requested alignment is less or equal to the fundamental alignment). |
| 10 |
Only cases are detected (by design) where the ``operator new`` is not |
| 11 |
user-defined and is not a placement new (the reason is that in these cases we |
| 12 |
assume that the user provided the correct memory allocation). |
| 13 |
|
| 14 |
This check corresponds to the CERT C++ Coding Standard rule |
| 15 |
`MEM57-CPP. Avoid using default operator new for over-aligned types |
| 16 |
<https://wiki.sei.cmu.edu/confluence/display/cplusplus/MEM57-CPP.+Avoid+using+default+operator+new+for+over-aligned+types>`_. |