[PATCH] D25244: [clang-tidy] Add a whitelist option in google-runtime-references.

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 7 11:23:03 PDT 2016


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM with a small nit.



================
Comment at: clang-tidy/google/NonConstReferences.cpp:71-75
+  for (const auto &WhiteListType: WhiteListTypes) {
+    if (ReferencedType.getCanonicalType().getAsString(
+            Result.Context->getPrintingPolicy()) == WhiteListType)
+      return;
+  }
----------------
I think this would be a bit easier to read with std::find_if rather than a manual loop. If you decide to stick with the manual loop, the colon in the range-based for loop needs a preceding space.


https://reviews.llvm.org/D25244





More information about the cfe-commits mailing list