<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Date: Tue, 30 Aug 2011 07:13:21 -0700<br>
From: Douglas Gregor <<a href="mailto:dgregor@apple.com">dgregor@apple.com</a>><br>
Subject: Re: [cfe-commits] Request feedback for new diagnostic feature<br>
        - template type diffing<br>
To: Chandler Carruth <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>><br>
Cc: llvm cfe <<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a>><br>
Message-ID: <<a href="mailto:CD5010A7-59BE-4D63-AF60-8732DD79811C@apple.com">CD5010A7-59BE-4D63-AF60-8732DD79811C@apple.com</a>><br>
Content-Type: text/plain; charset="windows-1252"<br>
<br>
> My problem is this: thus far, Clang's colors, bold, and other markup of the textual output don't add any information, they just make the information displayed easier to read. I like that distinction, because we have a lot of users who will at some points not have color or bold available when looking at the text. This happens either due to disabilities, deficient terminals, terminal preferences, ssh silliness, or because the diagnostics have gone through a layer of textual logging that tried to strip escape codes. Lots of different reasons this can happen.<br>

<br>
This is a good point.<br>
<br>
> As a result, I've found it very important that the user can usually get the full benefit of the improved diagnostic even w/o these nice-to-have markups. This is the first time (I think) that we're adding a really significant amount of logic to convey information that would be lost without the colors / markup. (Another interesting example is that we break the underlining of source ranges into ~s on a separate line in ascii art rather than using the underlining escape codes.)<br>

><br>
> Can you think up a way to not have to make this compromise? That is, could we present this information in a way that didn't require colors or other special terminal features *and* didn't have the downside of notes (searching, etc)? I haven't been able to, but that would be my preference. While I would love to take advantage of a more rich medium when available (*cough* IDEs make this easy *cough*), I'd like to get as much of this benefit into the plain-old-text output as possible, with the understanding that we have a lot of users which will loose some or all of the markup we apply to the text...<br>

<br>
We could consider some kind of substitution scheme, e.g.,<br>
<br>
>> type-diff.cc:23:6: note: candidate function not viable: no known conversion from 'A<B<#1> >, B<#2>' to<br>
>> >       'A<B<#3>, B<#4> >' for 1st argument; [with #1 = C<D<int>, #2 = C<const double> >, #3 = C<D<const int> >, #4 = C<D<const double> >]<br>

<br>
It's not beautiful, but it does a decent job of showing the common structure while isolating the parts that differ.<br>
<br>
        - Doug<br></blockquote></div><br>Hello,<br><br>Having issues of color-blindness, I am wary of encoding information into colors (though I do see most of them).<br><br>I think that the substitution scheme works quite good actually, however for ease of use I would change the names and order to group more clearly those groups that were supposed to be equal.<br>
<br>
>> type-diff.cc:23:6: note: candidate function not viable: no 
known conversion from 'A<B<#a0> >, B<#b0>' to <br>
>> >       'A<B<#a1>, B<#b1> >' for 1st 
argument; [with #a0 = C<D<int>,
 #a1 = C<D<const int> , #b0 = C<const double> >>, #b1 = C<D<const double> 
>]<br><br>I would also suggest that in case of multi-line diagnostic we might be willing to help the printer by inserting line-break hints within the line:<br><br>> [with #a0 = C<short, const short, int, const int, unsigned, const unsigned, double, const double, float, const float>,
 #a1 = C<short, const short, int, const int, unsigned, unsigned, double, const double, float, const float>]<br><br>does not help much, but:<br><br>> [with #a0 = C<short, const short, int, const int, unsigned,
 const unsigned, double, const double, float, const float>,<br>   _____#a1 = C<short, const short, int, const int, unsigned, unsigned,
 double, const double, float, const float>]<br><br>does.<br><br>(crossing my fingers hoping this won't get mangled so much as making my point unreadable...)<br><br>I believe it should be possible to pass "alignment" hints in the message, to be used by the printer when the text of the diagnostic goes multi-line (though admittedly I didn't thought one iota about *how* to pass such information).<br>
<br>-- Matthieu<br>