This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 112e. See for the official list.


1725. Trailing return type with nested function declarator

Section:  []     Status: NAD     Submitter: Richard Smith     Date: 2013-08-01

The treatment of a declaration like the following is not clear:

   auto (*f())() -> int; // #1 [dcl.fct] paragraph 2 appears to require determining the type of the nested declarator

   auto (*f()); // #2

which, because it does not have a trailing-return-type, would be ill-formed by (C++11) []. (In C++14, an auto return type without a trailing-return-type is, of course, permitted.)

Rationale (September, 2013):

The intent of the C++11 wording is that the requirement for a trailing return type applies only at the top level of the declarator to which auto applies, not to each possible recursive stage in the declarator processing. Also, as noted, the issue becomes moot with the changes enabling return type deduction.