[PATCH] D67545: [clang-tidy] Added DefaultOperatorNewCheck.
Gabor Marton via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 18 05:16:28 PDT 2019
martong added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/cert/DefaultOperatorNewCheck.cpp:38
+ return;
+
+ ASTContext &Context = D->getASTContext();
----------------
Would it make sense to early return here if the language dialect is >= C++17 ?
================
Comment at: clang-tools-extra/clang-tidy/cert/DefaultOperatorNewCheck.cpp:51
+ // The alignment used by default 'operator new' (in bits).
+ const unsigned DefaultAlignment = Context.getTargetInfo().getNewAlign();
+
----------------
What is the difference between "default" and "fundamental" alignment? Are they the same? Can they differ in any architecture?
https://wiki.sei.cmu.edu/confluence/display/cplusplus/MEM57-CPP.+Avoid+using+default+operator+new+for+over-aligned+types
Here there is no wording of "default alignment" only "fundamental alignment" is mentioned. Based on this I'd call this as `FundamentalAligment`.
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