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++ Patch] PR 58633 (Take 2)


Hi,

this is a completely different approach at fixing the bug, which overall I like better.

In this case most of the patch touches cp_parser_decltype_expr: instead of using cp_parser_postfix_expression only for member access expressions, we accept all its valid return values (still identifying the member access expressions, of course, because the semantics of decltype is special for those). Thus we can also immediately accept the pseudo destructor calls which are the matter of this bug. Otherwise, as a last resort, if the expression at issue isn't a postfix expression at all, we use cp_parser_expression.

Patch works better than my previous try from the diagnostic point of view (eg, for c++/47277 - type illegal expressions as arguments of the decltype) and seems less "hackish" to me. Also, it seems to me that it's a computational waste to redo the parsing of valid postfix-expressions != member access expression.

Tested x86_64-linux.

Thanks!
Paolo.

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

Attachment: CL_58633_2
Description: Text document

Attachment: patch_58633_2
Description: Text document


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