Title
Incomplete return type should be allowed in decltype operand
Status
nad
Section
6.3 [basic.def.odr]
Submitter
DE

Created on 2010-08-02.00:00:00 last changed 17 months ago

Messages

Date: 2022-11-20.07:54:16

Note:

This issue was raised again at the March, 2011 meeting and paper N3276, implementing this recommendation, was adopted for the FDIS.

Date: 2010-11-15.00:00:00

Rationale (November, 2010):

The CWG was persuaded by the SFINAE consideration.

Date: 2010-10-15.00:00:00

Additional note (October, 2010):

Another potential consideration in this question is the use of the return type in template argument deduction. If the return type is a specialization of a class template, one would want an error occurring in the instantiation of that specialization to cause a deduction failure, which would argue in favor of requiring the type to be complete. (However, that might also be covered by “when the completeness of the class type affects the semantics of the program” in 13.9.2 [temp.inst] paragraph 1.)

Date: 2022-09-25.18:08:42
N3092 comment DE 9
N3092 comment US 22

decltype applied to a function call expression requires a complete type (7.6.1.3 [expr.call] paragraph 3 and 6.3 [basic.def.odr] paragraph 4), even though decltype's result might be used in a way that does not actually require a complete type. This might cause undesired and excessive template instantiations. Immediately applying decltype should not require a complete type, for example, for the return type of a function call.

History
Date User Action Args
2022-11-20 07:54:16adminsetmessages: + msg7026
2010-11-29 00:00:00adminsetmessages: + msg3211
2010-11-29 00:00:00adminsetstatus: open -> nad
2010-10-18 00:00:00adminsetmessages: + msg3006
2010-08-02 00:00:00admincreate