================
@@ -0,0 +1,12 @@
+// RUN: %check_clang_tidy %s -std=c++14 
bugprone-default-operator-new-on-overaligned-type %t
----------------
zeyi2 wrote:

I did some furthur investigating, I think this check explicitly disables itself 
for C++17 or later:

In `DefaultOperatorNewOnOveralignedTypeCheck.h` at 
[L26](https://github.com/zeyi2/llvm-project/blob/7cb6b293ef9169b7dbd9968624ff5090e5ff8b3e/clang-tools-extra/clang-tidy/bugprone/DefaultOperatorNewOnOveralignedTypeCheck.h#L26),
 `DefaultOperatorNewOnOveralignedTypeCheck::isLanguageVersionSupported` returns 
`!LangOpts.CPlusPlus17`

I think the reason is because from C++17 onward, Clang [enables aligned 
allocation](https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Driver/Options.td#L3696)
  by default. So this tidy check becomes redundant and is disabled.

Should we remove this test file?

https://github.com/llvm/llvm-project/pull/165542
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to