[PATCH] D108469: Improve handling of static assert messages.

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 27 12:44:46 PDT 2022


erichkeane added inline comments.


================
Comment at: clang/lib/Basic/Diagnostic.cpp:837
+          llvm::sys::unicode::isFormatting(CodepointValue)) {
+        OutStr.append(CodepointBegin, CodepointEnd);
+        continue;
----------------
cor3ntin wrote:
> cor3ntin wrote:
> > erichkeane wrote:
> > > What about...?
> > I doesn't seem much better but sure, I can do that
> actually, you would need something like
> `OutStream.write(reinterpret_cast<const char*>(CodepointBegin), std::distance(CodepointBegin, CodepointEnd));`
> 
> Unless you insist, I'd rather not change it.
I just see value in having ALL accesses of the string be done 'the same' vs counting on it being unbuffered, which makes it harder to read.  And I think the 'stream' versions of the other uses below are a vast improvement that makes this touch of ugliness perhaps worth it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108469



More information about the cfe-commits mailing list