Skip to content

Commit

Permalink
[dcl.init.ref] Clarify "related type"
Browse files Browse the repository at this point in the history
"Related type" is not a term, "reference-related type" is clearer.
  • Loading branch information
frederick-vs-ja authored and tkoeppe committed Nov 12, 2023
1 parent f5fdfe4 commit 38dfe3d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/declarations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5721,9 +5721,10 @@
const int& r3 = a; // error: cv-qualifier dropped
// from result of conversion function
double d2 = 1.0;
double&& rrd2 = d2; // error: initializer is lvalue of related type
double&& rrd2 = d2; // error: initializer is lvalue of reference-related type
struct X { operator int&(); };
int&& rri2 = X(); // error: result of conversion function is lvalue of related type
int&& rri2 = X(); // error: result of conversion function is
// lvalue of reference-related type
int i3 = 2;
double&& rrd3 = i3; // \tcode{rrd3} refers to temporary with value \tcode{2.0}
\end{codeblock}
Expand Down

0 comments on commit 38dfe3d

Please sign in to comment.