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 58535


Hi,

in this [4.8/4.9] diagnostic regression the gcc_assert in check_member_templates trips:

      /* The parser rejects any use of virtual in a function template.  */
      gcc_assert (!(TREE_CODE (decl) == FUNCTION_DECL
            && DECL_VIRTUAL_P (decl)));

the ultimate reason being that in r187587 we inadvertently (I suppose, because the change has no relation to the rest of the commit and isn't explained) changed cp_parser_function_specifier_opt to always set ds_virtual in decl_specs, upon error too. Thus the below first hunk simply reverts that change and is enough to fix the primary bug.

Then, in mainline only, we have a variant of the issue for our implicit function templates extension, which requires a little more work, because when we parse 'virtual' we don't know yet that all the function parameters will be auto. To handle that I'm adding a check in finish_fully_implicit_template.

Tested x86_64-linux.

Thanks,
Paolo.

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

Attachment: CL_58565
Description: Text document

Attachment: patch_58565
Description: Text document


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