This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[C++ diagnostic Patch] Partially fix c++/58363 and more


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.

Thanks!
Paolo.

///////////////////////

Attachment: CL
Description: Text document

Attachment: p
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]