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 65775 ("Late-specified return type bypasses return type checks (qualified, function, array)")


Hi,

in grokdeclarator the checks on the return type do nothing useful in case of late-specified return type because they happen too early, before splice_late_return_type is called. A straightforward way to solve the problem involves separating the checks themselves to a new check_function_return_type and calling it again only in case splice_late_return_type actually spliced the late return type (in that case, we should also consistently update type_quals).

As a side issue, if we want to use good and consistent locations for the error messages (the testcase below checks that too), we need a fall back to input_location for typespec_loc, because otherwise an UNKNOWN_LOCATION is used for the error messages of testcases like lambda-syntax1.C and pr60190.C.

Tested x86_64-linux.

Thanks, Paolo.

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

Attachment: CL_65775
Description: Text document

Attachment: patch_65775
Description: Text document


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