Skip to content

Commit 8400611

Browse files
burblebeetkoeppe
authored andcommitted
CWG2887 Missing compatibility entries for xvalues
1 parent 56758c0 commit 8400611

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

source/compatibility.tex

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1997,6 +1997,28 @@
19971997
\end{codeblock}
19981998
\end{example}
19991999

2000+
\diffref{expr.typeid}
2001+
\change
2002+
Evaluation of operands in \keyword{typeid}.
2003+
\rationale
2004+
Introduce additional expression value categories.
2005+
\effect
2006+
Valid \CppIII{} code that uses xvalues as operands for \keyword{typeid}
2007+
may change behavior in this revision of \Cpp{}.
2008+
\begin{example}
2009+
\begin{codeblock}
2010+
void f() {
2011+
struct B {
2012+
B() {}
2013+
virtual ~B() { }
2014+
};
2015+
2016+
struct C { B b; };
2017+
typeid(C().b); // unevaluated in \CppIII{}, evaluated in \CppXI{}
2018+
}
2019+
\end{codeblock}
2020+
\end{example}
2021+
20002022
\diffref{expr.mul}
20012023
\change
20022024
Specify rounding for results of integer \tcode{/} and \tcode{\%}.
@@ -2023,6 +2045,31 @@
20232045
\end{codeblock}
20242046
\end{example}
20252047

2048+
\diffref{expr.cond}
2049+
\change
2050+
Fewer copies in the conditional operator.
2051+
\rationale
2052+
Introduce additional expression value categories.
2053+
\effect
2054+
Valid \CppIII{} code that uses xvalues as operands for the conditional operator
2055+
may change behavior in this revision of \Cpp{}.
2056+
\begin{example}
2057+
\begin{codeblock}
2058+
void f() {
2059+
struct B {
2060+
B() {}
2061+
B(const B&) { }
2062+
};
2063+
struct D : B {};
2064+
2065+
struct BB { B b; };
2066+
struct DD { D d; };
2067+
2068+
true ? BB().b : DD().d; // additional copy in \CppIII{}, no copy or move in \CppXI{}
2069+
}
2070+
\end{codeblock}
2071+
\end{example}
2072+
20262073
\rSec2[diff.cpp03.dcl.dcl]{\ref{dcl.dcl}: declarations}
20272074

20282075
\diffref{dcl.spec}

0 commit comments

Comments
 (0)