A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.github.io/CWG/issues/1892.html below:

CWG Issue 1892

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

2025-08-11

1892. Use of auto in function typeSection: 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 the auto specifier 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 in the decl-specifier-seq, type-specifier-seq, conversion-function-id, or trailing-return-type, in any context where such a declarator is valid. If the function declarator includes a trailing-return-type (9.3.4.6 [dcl.fct]), that specifies the declared return type of the function. Otherwise, the function declarator shall declare a function. If the declared return type of the function contains a placeholder type, the return type of the function is deduced from return statements in the body of the function, if any.

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4