[PATCH] D34404: [Clang-Tidy] Preserve Message, FileOffset, FilePath in Clang-Tidy YAML output

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 5 04:47:56 PDT 2017


alexfh added inline comments.


================
Comment at: unittests/clang-apply-replacements/ApplyReplacementsTest.cpp:23
+  SmallVector<DiagnosticMessage, 1> EmptyNotes;
+  return tooling::Diagnostic(DiagnosticName, Message, Replacements, EmptyNotes,
+                             tooling::Diagnostic::Warning, BuildDirectory);
----------------
vladimir.plyashkun wrote:
> alexfh wrote:
> > alexfh wrote:
> > > Will `{}` work instead of `EmptyNotes`?
> > `tooling::` is not needed due to the using directive above. Same below.
> Unfortunately, no.
> Constructor expects non-const reference `SmallVector<DiagnosticMessage, 1> &Notes`, so i can't pass rvalue directly to it.
I overlooked this when committing someone's patch. Fixed in r307143. Now you can add `const` and probably also use `{}`.


Repository:
  rL LLVM

https://reviews.llvm.org/D34404





More information about the cfe-commits mailing list