Skip to content

Commit e6e17d5

Browse files
committed
[diff.cpp20.{dcl,expr}] Fix subclause order to match main document
1 parent ebb4a11 commit e6e17d5

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

source/compatibility.tex

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -39,36 +39,6 @@
3939
auto c = L"a" U"b"; // was conditionally-supported; now ill-formed
4040
\end{codeblock}
4141

42-
\rSec2[diff.cpp20.dcl]{\ref{dcl.dcl}: declarations}
43-
44-
\diffref{dcl.init.string}
45-
\change
46-
UTF-8 string literals may initialize arrays of \keyword{char} or
47-
\tcode{\keyword{unsigned} \keyword{char}}.
48-
\rationale
49-
Compatibility with previously written code that conformed to previous versions of this document.
50-
\effect
51-
Arrays of \keyword{char} or \tcode{\keyword{unsigned} \keyword{char}}
52-
may now be initialized with a UTF-8 string literal.
53-
This can affect initialization that includes arrays
54-
that are directly initialized within class types, typically aggregates.
55-
For example:
56-
\begin{codeblock}
57-
struct A {
58-
char8_t s[10];
59-
};
60-
struct B {
61-
char s[10];
62-
};
63-
64-
void f(A);
65-
void f(B);
66-
67-
int main() {
68-
f({u8""}); // ambiguous
69-
}
70-
\end{codeblock}
71-
7242
\rSec2[diff.cpp20.expr]{\ref{expr}: expressions}
7343

7444
\diffref{expr.prim.id.unqual}
@@ -99,6 +69,36 @@
9969
// now equivalent to \tcode{arr.operator[](1, 2)} or ill-formed
10070
\end{codeblock}
10171

72+
\rSec2[diff.cpp20.dcl]{\ref{dcl.dcl}: declarations}
73+
74+
\diffref{dcl.init.string}
75+
\change
76+
UTF-8 string literals may initialize arrays of \keyword{char} or
77+
\tcode{\keyword{unsigned} \keyword{char}}.
78+
\rationale
79+
Compatibility with previously written code that conformed to previous versions of this document.
80+
\effect
81+
Arrays of \keyword{char} or \tcode{\keyword{unsigned} \keyword{char}}
82+
may now be initialized with a UTF-8 string literal.
83+
This can affect initialization that includes arrays
84+
that are directly initialized within class types, typically aggregates.
85+
For example:
86+
\begin{codeblock}
87+
struct A {
88+
char8_t s[10];
89+
};
90+
struct B {
91+
char s[10];
92+
};
93+
94+
void f(A);
95+
void f(B);
96+
97+
int main() {
98+
f({u8""}); // ambiguous
99+
}
100+
\end{codeblock}
101+
102102
\rSec2[diff.cpp20.temp]{\ref{temp}: templates}
103103

104104
\diffref{temp.deduct.type}

0 commit comments

Comments
 (0)