Movatterモバイル変換


[0]ホーム

URL:


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

2025-11-05


1850. Differences between definition context and point of instantiation

Section:13.8  [temp.res]    Status:CD4    Submitter:Richard Smith    Date:2014-02-04

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

Various characteristics of entities referred to by a non-dependentreference in a template can change between the definition context andthe point of instantiation of a specialization of that template. Theseinclude initialization (which affects whether an object can be usedin a constant expression), function and template default arguments,and the completeness of types. There is implementation divergenceas to whether these are checked in the definition context or at thepoint of instantiation. Presumably a rule is needed to make itill-formed, no diagnostic required, if the validity of such areference changes between the two contexts.

Proposed resolution (February, 2014):

Change 13.8 [temp.res] paragraph 8 as follows:

...If atype used in a non-dependent name is incomplete at the pointat which a template is defined but is complete at the point at which aninstantiation is done, and if the completeness of that type affects whetheror not the program is well-formed or affects the semantics of theprogram,hypothetical instantiation of a template immediatelyfollowing its definition would be ill-formed due to a construct that doesnot depend on a template parameter, the program is ill-formed; nodiagnostic is required. If the interpretation of such a construct in thehypothetical instantiation is different from the interpretation of thecorresponding construct in any actual instantiation of the template,the program is ill-formed; no diagnostic is required.[Note:This can happen in situations including the following:

end note] [Note: If atemplate is instantiated...




[8]ページ先頭

©2009-2025 Movatter.jp