[PATCH] D107900: Add a new clang-tidy check for trivially copyable types passed by const reference

Julien Marrec via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 11 07:54:06 PDT 2021


jmarrec added inline comments.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/misc-pod-const-ref-to-value.cpp:3-5
+int f1(const int &i);
+// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: argument 'i' is a trivially copyable type and should not be passed by const-reference but by value [misc-pod-const-ref-to-value]
+// CHECK-FIXES: int f1(int i);
----------------
This is now failing after I applied clang-format.  `int f1(const int& i)` would correctly produce `int f1(int i);`, now it does `int f1(inti);`... I need to find a way to fix that.


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

https://reviews.llvm.org/D107900



More information about the cfe-commits mailing list