Topic: Incomplete type?
Author: Gabriel Netterdag <gabriel.netterdag@quidsoft.se>
Date: 1999/06/30 Raw View
Should the following be well-formed?
struct S {
void foo(S) {} // parameter type incomplete?
S bar() {} // return type incomplete?
};
I always thought it was supposed to be
well-formed, but the sections quoted
from the Standard below seems to make
this ill-formed. Is this the intention?
or am I missing something?
3.2 / 4
A class type T must be complete if:
=97 a function with a return type or argument type of type T is defined
(shouldn't the word 'argument' above, be 'parameter'?)
9.2 / 2
A class is considered a completely=ADdefined object type (3.9)
(or complete type) at the closing } of the class=ADspecifier.
Within the class member=ADspecification, the class is regarded
as complete within function bodies, default arguments and
constructor ctor=ADinitializers (including such things in nested classes).
Otherwise it is regarded as incomplete within its own class
member=ADspecification.=20
Regards
//Gabriel
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: wmm@fastdial.net
Date: 1999/07/02 Raw View
In article <377A863A.59B64877@quidsoft.se>,
Gabriel Netterdag <gabriel.netterdag@quidsoft.se> wrote:
> Should the following be well-formed?
>
> struct S {
> void foo(S) {} // parameter type incomplete?
> S bar() {} // return type incomplete?
> };
>
> I always thought it was supposed to be
> well-formed, but the sections quoted
> from the Standard below seems to make
> this ill-formed. Is this the intention?
> or am I missing something?
>
> 3.2 / 4
> A class type T must be complete if:
> =97 a function with a return type or argument type of type T is
defined
>
> (shouldn't the word 'argument' above, be 'parameter'?)
>
> 9.2 / 2
> A class is considered a completely=ADdefined object type (3.9)
> (or complete type) at the closing } of the class=ADspecifier.
> Within the class member=ADspecification, the class is regarded
> as complete within function bodies, default arguments and
> constructor ctor=ADinitializers (including such things in nested
classes).
> Otherwise it is regarded as incomplete within its own class
> member=ADspecification.=20
Yes, it's supposed to be well-formed (and was clearly so when
in-class definitions of member functions were defined by the
rewrite rule, cf ARM p178). It appears that the replacement of
the rewrite rule by the scope and lookup rules may have
overlooked this particular issue.
--
William M. Miller, wmm@fastdial.net
Software Emancipation Technology (www.setech.com)
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]