dsanders marked an inline comment as done.
dsanders added inline comments.

================
Comment at: 
clang-tools-extra/clang-tidy/llvm/PreferRegisterOverUnsignedCheck.cpp:53
+  }
+  diag(UserVarDecl->getLocation(), "use '%0'", DiagnosticIDs::Note)
+      << Replacement
----------------
aaron.ballman wrote:
> I don't think you should issue a second diagnostic on the same line. Instead, 
> only issue the previous diagnostic with the fixit attached to it.
I don't mind changing this but I thought I should mention that I'm following 
the example set by the code generated by add_new_check.py which has the 
diagnostic separate from the note with the fixit:
```
  diag(MatchedDecl->getLocation(), "function %%0 is insufficiently awesome")
      << MatchedDecl;
  diag(MatchedDecl->getLocation(), "insert 'awesome'", DiagnosticIDs::Note)
      << FixItHint::CreateInsertion(MatchedDecl->getLocation(), "awesome_");
```
Is the example doing it the right way?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65919



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

Reply via email to