[PATCH] D17491: Add performance check to flag function parameters of expensive to copy types that can be safely converted to const references.

Matt Kulukundis via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 22 08:43:01 PDT 2016


fowles added a subscriber: fowles.

================
Comment at: test/clang-tidy/performance-unnecessary-value-param.cpp:8
@@ +7,3 @@
+  void nonConstMethod() {}
+  virtual ~ExpensiveToCopyType() {}
+};
----------------
you don't actually need to fill in these methods, just declare them

================
Comment at: test/clang-tidy/performance-unnecessary-value-param.cpp:52
@@ +51,3 @@
+void positiveUnnamedParam(const ExpensiveToCopyType) {
+  // CHECK-MESSAGES: [[@LINE-1]]:52: warning: the const qualified parameter #1
+}
----------------
no fix for this case?


http://reviews.llvm.org/D17491





More information about the cfe-commits mailing list