Skip to content

Commit 8cff053

Browse files
burblebeetkoeppe
authored andcommitted
CWG2312 Structured bindings and mutable
1 parent d5e8108 commit 8cff053

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

source/declarations.tex

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6581,7 +6581,7 @@
65816581
that is a function template whose first template parameter
65826582
is a non-type parameter,
65836583
the initializer is
6584-
\tcode{\exposid{e}.get<i>()}. Otherwise, the initializer is \tcode{get<i>(\exposid{e})},
6584+
\tcode{\exposidnc{e}.get<i>()}. Otherwise, the initializer is \tcode{get<i>(\exposid{e})},
65856585
where \tcode{get} is looked up in the associated namespaces\iref{basic.lookup.argdep}.
65866586
In either case, \tcode{get<i>} is interpreted as a \grammarterm{template-id}.
65876587
\begin{note}
@@ -6610,7 +6610,7 @@
66106610
all of \tcode{E}'s non-static data members
66116611
shall be direct members of \tcode{E} or
66126612
of the same base class of \tcode{E},
6613-
well-formed when named as \tcode{\exposid{e}.\placeholder{name}}
6613+
well-formed when named as \tcode{\exposidnc{e}.\placeholder{name}}
66146614
in the context of the structured binding,
66156615
\tcode{E} shall not have an anonymous union member, and
66166616
the number of elements in the \grammarterm{identifier-list} shall be
@@ -6620,16 +6620,20 @@
66206620
(in declaration order),
66216621
each \tcode{v}$_i$ is the
66226622
name of an lvalue that refers to the member \tcode{m}$_i$ of \exposid{e} and
6623-
whose type is \cv{}~$\tcode{T}_i$, where $\tcode{T}_i$ is the declared type of
6624-
that member; the referenced type is \cv{}~$\tcode{T}_i$. The lvalue is a
6623+
whose type is
6624+
that of \tcode{\exposidnc{e}.$\tcode{m}_i$}\iref{expr.ref};
6625+
the referenced type is
6626+
the declared type of $\tcode{m}_i$ if that type is a reference type, or
6627+
the type of \tcode{\exposidnc{e}.$\tcode{m}_i$} otherwise.
6628+
The lvalue is a
66256629
bit-field if that member is a bit-field.
66266630
\begin{example}
66276631
\begin{codeblock}
6628-
struct S { int x1 : 2; volatile double y1; };
6632+
struct S { mutable int x1 : 2; volatile double y1; };
66296633
S f();
66306634
const auto [ x, y ] = f();
66316635
\end{codeblock}
6632-
The type of the \grammarterm{id-expression} \tcode{x} is ``\tcode{const int}'',
6636+
The type of the \grammarterm{id-expression} \tcode{x} is ``\tcode{int}'',
66336637
the type of the \grammarterm{id-expression} \tcode{y} is ``\tcode{const volatile double}''.
66346638
\end{example}
66356639

0 commit comments

Comments
 (0)