File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 57395739\begin {itemize }
57405740\item
57415741If the \grammarterm {braced-init-list}
5742- contains a \grammarterm {designated-initializer-list},
5742+ contains a \grammarterm {designated-initializer-list} and
5743+ \tcode {T} is not a reference type,
57435744\tcode {T} shall be an aggregate class.
57445745The ordered \grammarterm {identifier}{s}
57455746in the \grammarterm {designator}{s}
58635864\end {example }
58645865
58655866\item Otherwise, if
5866- the initializer list has a single element of type \tcode {E} and either
5867+ the initializer list
5868+ is not a \grammarterm {designated-initializer-list} and
5869+ has a single element of type \tcode {E} and either
58675870\tcode {T} is not a reference type or its referenced type is
58685871reference-related to \tcode {E}, the object or reference is initialized
58695872from that element (by copy-initialization for copy-list-initialization,
59085911struct A { } a;
59095912struct B { explicit B(const A&); };
59105913const B& b2{a}; // error: cannot copy-list-initialize \tcode {B} temporary from \tcode {A}
5914+
5915+ struct C { int x; };
5916+ C&& c = { .x = 1 }; // OK
59115917\end {codeblock }
59125918\end {example }
59135919
Original file line number Diff line number Diff line change 23562356expression and special rules apply for converting it to a parameter type.
23572357
23582358\pnum
2359- If the initializer list is a \grammarterm {designated-initializer-list},
2359+ If the initializer list is a \grammarterm {designated-initializer-list}
2360+ and the parameter is not a reference,
23602361a conversion is only possible if
23612362the parameter has an aggregate type
23622363that can be initialized from the initializer list
You can’t perform that action at this time.
0 commit comments