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] Diagnose invalid auto fndecl without late return type or non-auto fndecl with late return type (PR c++/37967)


Jakub Jelinek wrote:
From my reading auto foo (); is invalid, as auto for function decls is
only allowed for late return types.

Yes.


Also, IMHO late return type requires
auto type and
"the type of the contained declarator-id in the declaration T D1 is
 `derived-declarator-type-list T,' T shall be the single type-specifier
 auto and the derived-declarator-type-list shall be empty."
IMHO means that even auto *foo () -> int; is invalid (correct me if
I'm wrong).

You are correct; I was waiting to implement that restriction until the changes to its specification settled down. The eventual resolution was:


http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#681

Ok for trunk?

Yes.


Jason


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