Skip to content

Commit f811dc0

Browse files
committed
CWG2887 Missing compatibility entries for xvalues
1 parent 4e6659f commit f811dc0

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
@@ -1995,6 +1995,28 @@
19951995
\end{codeblock}
19961996
\end{example}
19971997

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

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

20262073
\diffref{dcl.spec}

0 commit comments

Comments
 (0)