A RetroSearch Logo

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

Search Query:

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

CWG Issue 2044

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

2044. decltype(auto) and voidSection: 9.2.9.7  [dcl.spec.auto]     Status: CD4     Submitter: Richard Smith     Date: 2014-11-14

[Adopted at the February, 2016 meeting.]

The resolution of issue 1877 does not correctly handle decltype(auto) return types with void return expressions:

  T f();
  decltype(auto) g() { return f(); }

fails when T is void.

Suggested resolution:

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

...In the case of a return with no operand or with an operand of type void, the declared return type shall be auto or decltype(auto) and the deduced return type is void. Otherwise...

Proposed resolution (September, 2015):

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

When a variable declared using a placeholder type is initialized, or a return statement occurs in a function declared with a return type that contains a placeholder type, the deduced return type or variable type is determined from the type of its initializer. In the case of a return with no operand or with an operand of type void , :

Otherwise, let T be...


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