Movatterモバイル変換


[0]ホーム

URL:


This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 119a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-12-20


1892. Use ofauto in function type

Section:9.2.9.7  [dcl.spec.auto]    Status:CD4    Submitter:Richard Smith    Date:2014-03-12

[Moved to DR at the November, 2014 meeting.]

There appear to be no restrictions against using theautospecifier in examples like the following:

  template<typename T> using X = T;  X<auto()> f_with_deduced_return_type; // ok  std::vector<auto(*)()> v; // ok?!  void f(auto (*)()); // ok?!

Proposed resolution (June, 2014):

Change 9.2.9.7 [dcl.spec.auto] paragraph 2 as follows:

The placeholder type can appear with a function declarator inthedecl-specifier-seq,type-specifier-seq,conversion-function-id, ortrailing-return-type, in anycontext where such a declarator is valid. If the function declaratorincludes atrailing-return-type (9.3.4.6 [dcl.fct]), thatspecifies the declared return type of the function.Otherwise, thefunction declarator shall declare a function. If the declared returntype of the function contains a placeholder type, the return type of thefunction is deduced from return statements in the body of the function, ifany.



[8]ページ先頭

©2009-2026 Movatter.jp