File tree Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Original file line number Diff line number Diff line change 3539
3539
\indextext {type!incompletely-defined object}%
3540
3540
A class that has been declared but not defined, an enumeration type in certain
3541
3541
contexts~(\ref {dcl.enum }), or an array of unknown
3542
- size or of incomplete element type, is an
3542
+ bound or of incomplete element type, is an
3543
3543
\defnx {incompletely-defined object type}{object type!incompletely-defined}.%
3544
3544
\footnote {The size and layout of an instance of an incompletely-defined
3545
3545
object type is unknown.}
3560
3560
point in a translation unit and complete later on; the array types at
3561
3561
those two points (`` array of unknown bound of \tcode {T}'' and `` array of
3562
3562
\tcode {N} \tcode {T}'' ) are different types. The type of a pointer to array of
3563
- unknown size , or of a type defined by a \tcode {typedef} declaration to
3564
- be an array of unknown size , cannot be completed. \begin {example }
3563
+ unknown bound , or of a type defined by a \tcode {typedef} declaration to
3564
+ be an array of unknown bound , cannot be completed. \begin {example }
3565
3565
3566
3566
\indextext {type!example of incomplete}%
3567
3567
\begin {codeblock }
Original file line number Diff line number Diff line change 2992
2992
expression not enclosed in braces, as described in~\ref {dcl.init }.
2993
2993
2994
2994
\pnum
2995
- An array of unknown size initialized with a
2995
+ An array of unknown bound initialized with a
2996
2996
brace-enclosed
2997
2997
\grammarterm {initializer-list}
2998
2998
containing
3002
3002
\tcode {n}
3003
3003
shall be greater than zero, is defined as having
3004
3004
\tcode {n}
3005
- elements (\ref {dcl.array }).
3005
+ elements~ (\ref {dcl.array }).
3006
3006
\begin {example }
3007
3007
3008
3008
\begin {codeblock }
3020
3020
for an array of unknown bound.\footnote {The syntax provides for empty
3021
3021
\grammarterm {initializer-list}{s},
3022
3022
but nonetheless \Cpp does not have zero length arrays.}
3023
+ \begin {note }
3024
+ A default member initializer does not determine the bound for a member
3025
+ array of unknown bound. Since the default member initializer is
3026
+ ignored if a suitable \grammarterm {mem-initializer} is present
3027
+ (\ref {class.base.init }), the default member initializer is not
3028
+ considered to initialize the array of unknown bound.
3029
+ \begin {example }
3030
+ \begin {codeblock }
3031
+ struct S {
3032
+ int y[] = { 0 }; // error: non-static data member of incomplete type
3033
+ };
3034
+ \end {codeblock }
3035
+ \end {example }
3036
+ \end {note }
3023
3037
3024
3038
\pnum
3025
3039
\begin {note }
You can’t perform that action at this time.
0 commit comments