[cfe-commits] r159463 - in /cfe/trunk: docs/InternalsManual.html include/clang/Basic/DiagnosticSemaKinds.td lib/Basic/Diagnostic.cpp test/Misc/diag-template-diffing-color.cpp

Richard Trieu rtrieu at google.com
Fri Jun 29 16:13:14 PDT 2012


On Fri, Jun 29, 2012 at 3:22 PM, Matt Beaumont-Gay <matthewbg at google.com>wrote:

> Nice; copy-editing inline.
>
> On Fri, Jun 29, 2012 at 2:12 PM, Richard Trieu <rtrieu at google.com> wrote:
> > Author: rtrieu
> > Date: Fri Jun 29 16:12:16 2012
> > New Revision: 159463
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=159463&view=rev
> > Log:
> > Update the %diff modifer to have an alternate string print when a
> template tree
> > is selected.  This will allow more flexibility when converting
> diagnostics to
> > use template type diffing.
> >
> > Also updated the internal manual and test cases for correctly keeping
> the bold
> > attribute and for tree printing.
> >
> > Modified:
> >    cfe/trunk/docs/InternalsManual.html
> >    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
> >    cfe/trunk/lib/Basic/Diagnostic.cpp
> >    cfe/trunk/test/Misc/diag-template-diffing-color.cpp
> >
> > Modified: cfe/trunk/docs/InternalsManual.html
> > URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/InternalsManual.html?rev=159463&r1=159462&r2=159463&view=diff
> >
> ==============================================================================
> > --- cfe/trunk/docs/InternalsManual.html (original)
> > +++ cfe/trunk/docs/InternalsManual.html Fri Jun 29 16:12:16 2012
> > @@ -361,7 +361,8 @@
> >  <tr><td colspan="2"><b>"diff" format</b></td></tr>
> >  <tr><td>Example:</td><td><tt>"no known conversion %diff{from | to |
> }1,2"</tt></td></tr>
> >  <tr><td>Class:</td><td>QualType</td></tr>
> > -<tr><td>Description</td><td><p>This formatter takes two QualTypes and
> attempts to print a template difference between the two.  If tree printing
> is off, the entire text inside the the braces is printed, with the
> formatted text replacing the pipes.  If tree printing is on, the text is
> not printed and a type tree is printed after the diagnostic
> message.</p></td></tr>
> > +<tr><td>Description</td><td><p>This formatter takes two QualTypes and
> attempts to print a template difference between the two.  If tree printing
> is off, the text inside the the braces before the pipe is printed, with the
> formatted text replacing the $.  If tree printing is on, the text after the
> pipe is printed and a type tree is printed after the diagnostic message.
> > +</p></td></tr>
> >
> >  </table>
> >
> >
> > Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
> > URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=159463&r1=159462&r2=159463&view=diff
> >
> ==============================================================================
> > --- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
> > +++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Fri Jun 29
> 16:12:16 2012
> > @@ -1150,22 +1150,21 @@
> >   "%select{none|const|restrict|const and restrict|volatile|const and
> volatile|"
> >   "volatile and restrict|const, volatile, and restrict}6)}4">;
> >
> > -def err_lvalue_to_rvalue_ref : Error<"rvalue reference to type %0
> cannot bind "
> > -  "to lvalue of type %1">;
> > +def err_lvalue_to_rvalue_ref : Error<"rvalue reference %diff{to type $
> cannot "
> > +  "bind to lvalue of type $|cannot bind to incompatible lvalue}0,1">;
> >  def err_lvalue_reference_bind_to_initlist : Error<
> >   "%select{non-const|volatile}0 lvalue reference to type %1 cannot bind
> to an "
> >   "initializer list temporary">;
> >  def err_lvalue_reference_bind_to_temporary : Error<
> > -  "%select{non-const|volatile}0 lvalue reference to type %1 cannot bind
> to a "
> > -  "temporary of type %2">;
> > +  "%select{non-const|volatile}0 lvalue reference %diff{to type $ cannot
> bind "
> > +  "to a temporary of type $|cannot bind to incompatible temporary}1,2">;
>
> This might read a little better as "cannot bind to temporary of
> incompatible type".
>
> >  def err_lvalue_reference_bind_to_unrelated : Error<
> > -  "%select{non-const|volatile}0 lvalue reference to type %1 cannot bind
> to a "
> > -  "value of unrelated type %2">;
> > +  "%select{non-const|volatile}0 lvalue reference %diff{to type $ cannot
> bind to a value of unrelated type $|cannot bind to a value of related
> type}1,2">;
>
> ITYM "value of _un_related type" in the tree-printing case?
>
> >  def err_reference_bind_drops_quals : Error<
> > -  "binding of reference to type %0 to a value of type %1 drops
> qualifiers">;
> > +  "binding of reference %diff{to type $ to a value of type $ drops "
> > +  "qualifiers|drops qualifiers}0,1">;
> >  def err_reference_bind_failed : Error<
> > -  "reference to type %0 could not bind to an %select{rvalue|lvalue}1 of
> type "
> > -  "%2">;
> > +  "reference %diff{to type $ could not bind to an
> %select{rvalue|lvalue}1 of type $|could not bing to
> %select{rvalue|lvalue}}0,2">;
>
> s/bing/bind/
>
> >  def err_reference_bind_init_list : Error<
> >   "reference to type %0 cannot bind to an initializer list">;
> >  def warn_temporary_array_to_pointer_decay : Warning<
> > @@ -2169,7 +2168,7 @@
> >     "function (the implicit copy assignment operator)|"
> >     "function (the implicit move assignment operator)|"
> >     "constructor (inherited)}0%1"
> > -    " not viable: no known conversion %diff{from | to | }2,3for "
> > +    " not viable: no known conversion %diff{from $ to $ |}2,3for "
>
> Maybe "from argument type to parameter type" in the tree-printing case?
>

Fixed in r159473.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120629/f3f9e7d0/attachment.html>


More information about the cfe-commits mailing list