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 19200


Hi,

another old issue, which should be also relatively easy to fix. The problem is clear, for:

struct S {
  struct T{};
  friend void S(T);
};

cp_parser_direct_declarator sees a name which matches that of a kosher constructor and sets sfk_constructor. Then things go quickly wrong because a constructor cannot have a return type specification, thus check_special_function_return_type, called by grokdeclarator, complains.

I tried various ideas (eg, I'm also attaching an alternate approach passing down the friend information from cp_parser_member_declaration to cp_parser_direct_declarator), but, all in all, I propose to adjust things in grodeclarator itself. Tested x86_64-linux.

Thanks!
Paolo.

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

Attachment: patch_19200
Description: Text document

Attachment: patch_19200_alt
Description: Text document


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