File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 4433
4433
4434
4434
\begin {bnf }
4435
4435
\nontermdef {noptr-new-declarator}\br
4436
- \terminal {[} expression \terminal {]} \opt {attribute-specifier-seq}\br
4436
+ \terminal {[} \opt { expression} \terminal {]} \opt {attribute-specifier-seq}\br
4437
4437
noptr-new-declarator \terminal {[} constant-expression \terminal {]} \opt {attribute-specifier-seq}
4438
4438
\end {bnf }
4439
4439
4548
4548
expression\iref {expr.const } of type \tcode {std::size_t} and
4549
4549
shall evaluate to a strictly positive value.
4550
4550
\indextext {\idxcode {new}}%
4551
- The \grammarterm {expression} in a \grammarterm {noptr-new-declarator} is
4552
- implicitly converted to \tcode {std::size_t}.
4551
+ If the \grammarterm {expression} in a \grammarterm {noptr-new-declarator}
4552
+ is present, it is implicitly converted to \tcode {std::size_t}.
4553
4553
\begin {example }
4554
4554
Given the definition \tcode {int n = 42},
4555
4555
\tcode {new float[n][5]} is well-formed (because \tcode {n} is the
4558
4558
constant expression).
4559
4559
\end {example }
4560
4560
4561
+ \pnum
4562
+ If the \grammarterm {type-id} or \grammarterm {new-type-id}
4563
+ denotes an array type of unknown bound\iref {dcl.array },
4564
+ the \grammarterm {new-initializer} shall not be omitted;
4565
+ the allocated object is an array with \tcode {n} elements,
4566
+ where \tcode {n} is determined from the number of initial elements
4567
+ supplied in
4568
+ the \grammarterm {new-initializer}~(\ref {dcl.init.aggr }, \ref {dcl.init.string }).
4569
+
4561
4570
\pnum
4562
4571
\indextext {function!allocation}%
4563
4572
The \grammarterm {expression} in a \grammarterm {noptr-new-declarator} is
You can’t perform that action at this time.
0 commit comments