scott.linder added a comment.

In D123878#3507378 <https://reviews.llvm.org/D123878#3507378>, @vangthao wrote:

> I am not sure if allowing clang to accept newlines is a good idea. It seems 
> like clang wants to know what type of message is being outputted. For example 
> whether this is a remark, warning, etc. but allowing for a diagnostic to 
> output their own newline makes it ambiguous where exactly that output is 
> coming from.

It already supports newlines in any diagnostic which doesn't use the trivial 
format string `"%0"`, and at least `clang/test/Misc/diag-line-wrapping.cpp` 
explicitly tests this behavior.

It seems reasonable that clang could add a prefix or indentation scheme while 
emitting multi-line diagnostics to the terminal, to help with the ambiguity 
issue. For example instead of the current output:

  clang/test/Misc/diag-line-wrapping.cpp:8:14: error: non-static member 'f' 
found in multiple base-class subobjects of type 'B':
      struct DD -> struct D1 -> struct B
      struct DD -> struct D2 -> struct B

Maybe we could have something like:

  clang/test/Misc/diag-line-wrapping.cpp:8:14: error: ...
  ...: non-static member 'f' found in multiple base-class subobjects of type 
'B':
  ...:     struct DD -> struct D1 -> struct B
  ...:     struct DD -> struct D2 -> struct B

I don't know if changing this kind of output is a breaking change, though? I do 
know some tooling parses this output.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123878

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

Reply via email to