jkorous requested changes to this revision.
jkorous added a comment.
This revision now requires changes to proceed.

Hi Sam, this looks good! 
I found just one small detail.



================
Comment at: clangd/Diagnostics.cpp:281
+    if (auto* Name = getDiagnosticCode(D.ID))
+      Main.code = Name;
     if (Opts.EmbedFixesInDiagnostics) {
----------------
It seems to me that in case `ID` is undefined (hits the default case in 
`getDiagnosticCode`) we are calling `std::string` non-explicit constructor with 
`nullptr` which is UB.
How about changing `char* getDiagnosticCode` to `Optional<char*> 
getDiagnosticCode` or similar to make it less error-prone?


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D58291



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

Reply via email to