Movatterモバイル変換


[0]ホーム

URL:


Issue 135 - WG21 CWG Issues
Title
Class type in in-class member function definitions
Status
tc1
Section
9.3.4.6 [dcl.fct]
Submitter
Gabriel Netterdag

Created on1999-07-01.00:00:00 last changed277 months ago

Messages

msg223 (view)
Date: 1999-10-15.00:00:00

Proposed resolution (10/00): Replace the last sentence of9.3.4.6 [dcl.fct] paragraph 6with

The type of a parameter or the return type for a function definitionshall not be an incomplete class type (possibly cv-qualified) unlessthe function definition is nested within themember-specification for that class (including definitions innested classes defined within the class).
msg134 (view)
Date: 2022-11-20.07:54:16

6.3 [basic.def.odr] paragraph 4and9.3.4.6 [dcl.fct] paragraph 6indicate thatthe return type and parameter types must be complete in a functiondefinition. However, when11.4 [class.mem] paragraph 2lists thecontexts in a classmember-specification in which the classis considered complete, the return type and parameter types of amember function defined in the class definition are not included.It thus appears that the following example is ill-formed:

    struct S {        S f() { return S(); }    // error: incomplete return type        void g(S) { }            // error: incomplete parameter type    };
Jack Rouse:I suggest supplementing the text in 8.3.5p6 with something like:
The type of a parameter or the return type for a function definitionshall not be an incomplete class type unless the function definitionis nested in themember-specification for that class (includingdefinitions in nested classes defined within the class).

Proposed resolution (10/00): Replace the last sentence of9.3.4.6 [dcl.fct] paragraph 6with

The type of a parameter or the return type for a function definitionshall not be an incomplete class type (possibly cv-qualified) unlessthe function definition is nested within themember-specification for that class (including definitions innested classes defined within the class).
History
DateUserActionArgs
2003-04-25 00:00:00adminsetstatus: dr -> tc1
2000-11-18 00:00:00adminsetstatus: ready -> dr
2000-05-21 00:00:00adminsetstatus: review -> ready
2000-02-23 00:00:00adminsetmessages: +msg223
2000-02-23 00:00:00adminsetstatus: open -> review
1999-07-01 00:00:00admincreate

[8]ページ先頭

©2009-2026 Movatter.jp