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]

Re: [C++ Patch] PR 34892


Hi again,

On 10/24/2012 09:53 PM, Jason Merrill wrote:
The parm shouldn't be a parameter pack in that case; the ... is part of the default argument, not the parameter.
I tracked down where this goes wrong, in the parser: the below recognizes when cp_parser_parameter_declaration doesn't parse a valid default argument and in that case "*is_parameter_pack = true;" doesn't happen. This means we have a very good diagnostics, only a single error message and nothing else, not even the maybe_warn_variadic_templates message in C++98 mode because I don't think the code can make any sense in any C++ dialect whatsoever (the latter would be easy to change of course)

Tested x86_64-linux, as usual.

Thanks,
Paolo.

PS: interestingly, detecting error_mark_node toward the end of cp_parser_parameter_declaration and turning it into a NULL_TREE leads to a single regression, at the end of pr39060.C, because NULL_TREE implies that we don't do anymore the diagnostics about default argument part of duplicate_decls (which ICC also gives). Besides that, for 34892 we give like 6 different error messages ;)

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

Attachment: CL_34892_2
Description: Text document

Attachment: patch_34892_2
Description: Text document


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