[PATCH] D67545: [clang-tidy] Added DefaultOperatorNewCheck.

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 17 02:03:48 PDT 2019


balazske marked an inline comment as done.
balazske added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/cert/DefaultOperatorNewCheck.cpp:49
+  if (HasDefaultOperatorNew && OverAligned)
+    diag(NewExpr->getBeginLoc(), "using default 'operator new' with over-aligned type %0 may result in undefined behavior")
+      << D;
----------------
martong wrote:
> I think it would be useful to add the value of the fundamental alignment to the diagnostics too.
Should be this the correct error message? "Allocation with standard new: too long alignment for a user type." Or "Allocation with standard new: too long alignment (//user_align//) for a user type, default is //default_align//."


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67545/new/

https://reviews.llvm.org/D67545





More information about the cfe-commits mailing list