Вторник, 18 февраля 2025, 0:11 +03:00 от Brian Bi <bbi5291@gmail.com>:
On Mon, Feb 17, 2025 at 3:09PM Vladimir Grigoriev via Std-Discussion <std-discussion@lists.isocpp.org> wrote:In p. 5 of the section 6.2 Declarations and definitions of the C++23 Standard there is written5 In the definition of an object, the type of that object shall not be an incomplete type (6.8), an abstract class type (11.7.4), or a (possibly multi-dimensional) array thereofAlso in p.5 of the sub-section 6.8.1 General of the section 6.8 Types there is written...The type of a pointer to array of unknown bound, or of a type defined by a typedef declaration to be an array of unknown bound, cannot be completed.And further there is followed an example (Example 3)class X; // X is an incomplete typeextern X* xp; // xp is a pointer to an incomplete typeextern int arr[]; // the type of arr is incompletetypedef int UNKA[]; // UNKA is an incomplete typeUNKA* arrp; // arrp is a pointer to an incomplete typeUNKA** arrpp;But according to the first provided quote this object definitionUNKA* arrp; // arrp is a pointer to an incomplete typeis invalid because such a pointer has an incomplete type.All pointer types are complete. What the standard means to say, but uses imprecise language to describe, is that `UNKA*` is a distinct type from `A*` where `A` is any array of known bound. This stands in contrast to the case of `X*`, which will be the same as the type `X*` later on when `X` is complete.--So it looks like the example does not make sense or do I have missed something?With best regards(Vlad from Moscow)
Std-Discussion mailing list
Std-Discussion@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-discussion
--Brian Bi