On Sun, Sep 8, 2013 at 3:26 PM, Paolo Carlini <paolo.carl...@oracle.com> wrote: > Hi all, Gaby, > > I was having a look to c++/58363 and besides the main issue, that is we > probably want to help the user and tell him/her something about destructors, > etc, I noticed that we aren't able to pretty print the pseudo destructor > expression at issue: > > cannot convert ‘f.#‘var_decl’ not supported by dump_type#<type error>::~’ > (type ‘void’) to type ‘int’ > > Weird. Thus I went to cp-tree.def and found the very clear comment: > > /* A pseudo-destructor, of the form "OBJECT.~DESTRUCTOR" or > "OBJECT.SCOPE::~DESTRUCTOR. The first operand is the OBJECT. The > second operand (if non-NULL) is the SCOPE. The third operand is > the TYPE node corresponding to the DESTRUCTOR. > > which in fact is inconsistent with the code in error.c:dump_expr. As regards > cxx-pretty-print.c, the code in postfix_expression seems largely Ok (that > confirmed my analysis), only I don't think the case of NULL second operand > is handled correctly. What do you think about the below? Certainly passes > the testsuite and the pretty printing for 58363 is Ok.
Looks good. OK to commit. I have been hoping that we would have ditched dump_expr and consorts, in favor of the C++ specific pretty printers, but now… -- Gaby