arphaman added a comment.

Thanks for working on this, some minor comments:



================
Comment at: Basic/DiagnosticIDs.cpp:612
       // Two matches with the same distance, don't prefer one over the other.
-      Best = "";
+      NearestOption = "";
     } else if (Distance < BestDistance) {
----------------
Do we a test case that covers this line?


================
Comment at: Basic/Warnings.cpp:34
+namespace {
+  constexpr unsigned MaxLevenshteinDistForWarningSuggestion = 2;
+}
----------------
It would be helpful to have a brief comment explaining the rationale behind 
using the number `2`.


================
Comment at: Basic/Warnings.cpp:35
+  constexpr unsigned MaxLevenshteinDistForWarningSuggestion = 2;
+}
+
----------------
NIT: Missing `//end anonymous namespace`.


================
Comment at: Basic/Warnings.cpp:48
+    << (!Suggestion.empty()
+      && OptToSuggestionEditDist > 0
+      && OptToSuggestionEditDist <= MaxLevenshteinDistForWarningSuggestion)
----------------
Is it ever possible to have an edit distance of `0`? Wouldn't it mean the 
strings are the same?


Repository:
  rC Clang

https://reviews.llvm.org/D49736



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to