Title
Trailing return type with nested function declarator
Status
nad
Section
9.2.9.7 [dcl.spec.auto]
Submitter
Richard Smith

Created on 2013-08-01.00:00:00 last changed 128 months ago

Messages

Date: 2013-09-15.00:00:00

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.

Date: 2022-11-20.07:54:16

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

   auto (*f())() -> int; // #1

9.3.4.6 [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) 9.2.9.7 [dcl.spec.auto]. (In C++14, an auto return type without a trailing-return-type is, of course, permitted.)

History
Date User Action Args
2013-10-14 00:00:00adminsetmessages: + msg4708
2013-10-14 00:00:00adminsetstatus: open -> nad
2013-08-01 00:00:00admincreate