Skip to content

Commit

Permalink
Some wording updates
Browse files Browse the repository at this point in the history
  • Loading branch information
brevzin committed Nov 5, 2024
1 parent 187f142 commit 8614074
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 25 deletions.
40 changes: 22 additions & 18 deletions 2996_reflection/p2996r8.html
Original file line number Diff line number Diff line change
Expand Up @@ -772,9 +772,9 @@ <h1 id="toctitle">Contents</h1>
expressions<span></span></a></li>
<li><a href="#expr.prim.id.splice-splice-specifiers" id="toc-expr.prim.id.splice-splice-specifiers">7.5.4.0*
[expr.prim.id.splice] Splice specifiers<span></span></a></li>
<li><a href="#expr.prim.id.general-general" id="toc-expr.prim.id.general-general"><span>7.5.4.1
<li><a href="#expr.prim.id.general-general" id="toc-expr.prim.id.general-general"><span>7.5.5.1
<span>[expr.prim.id.general]</span></span> General<span></span></a></li>
<li><a href="#expr.prim.id.qual-qualified-names" id="toc-expr.prim.id.qual-qualified-names"><span>7.5.4.3
<li><a href="#expr.prim.id.qual-qualified-names" id="toc-expr.prim.id.qual-qualified-names"><span>7.5.5.3
<span>[expr.prim.id.qual]</span></span> Qualified
names<span></span></a></li>
<li><a href="#expr.prim.splice-expression-splicing" id="toc-expr.prim.splice-expression-splicing">7.5.8* [expr.prim.splice]
Expand Down Expand Up @@ -1013,7 +1013,7 @@ <h1 data-number="1" style="border-bottom:1px solid #cccccc" id="revision-history
<code class="sourceCode cpp">has_complete_definition</code>.</li>
<li>removed <code class="sourceCode cpp">subobjects_of</code> and
<code class="sourceCode cpp">accessible_subobjects_of</code> (will be
reintroduced by <span class="citation" data-cites="P3293R1">[<a href="#ref-P3293R1" role="doc-biblioref"><strong>P3293R1?</strong></a>]</span>).</li>
reintroduced by <span class="citation" data-cites="P3293R1">[<a href="https://wg21.link/p3293r1" role="doc-biblioref">P3293R1</a>]</span>).</li>
<li>specified constraints for
<code class="sourceCode cpp">enumerators_of</code> in terms of
<code class="sourceCode cpp">has_complete_definition</code>.</li>
Expand Down Expand Up @@ -1932,7 +1932,7 @@ <h2 data-number="3.9" id="a-simple-variant-type"><span class="header-section-num
</blockquote>
</div>
<p>Arguably, the answer should be yes - this would be consistent with
how other accesses work. This is instead proposed in <span class="citation" data-cites="P3293R1">[<a href="#ref-P3293R1" role="doc-biblioref"><strong>P3293R1?</strong></a>]</span>.</p>
how other accesses work. This is instead proposed in <span class="citation" data-cites="P3293R1">[<a href="https://wg21.link/p3293r1" role="doc-biblioref">P3293R1</a>]</span>.</p>
<p>On Compiler Explorer: <a href="https://godbolt.org/z/Efz5vsjaa">EDG</a>, <a href="https://godbolt.org/z/3bvo97fqf">Clang</a>.</p>
<h2 data-number="3.10" id="struct-to-struct-of-arrays"><span class="header-section-number">3.10</span> Struct to Struct of Arrays<a href="#struct-to-struct-of-arrays" class="self-link"></a></h2>
<div class="std">
Expand Down Expand Up @@ -4438,7 +4438,7 @@ <h3 data-number="4.4.18" id="data_member_spec-define_aggregate"><span class="hea
<span id="cb94-10"><a href="#cb94-10" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb94-11"><a href="#cb94-11" aria-hidden="true" tabindex="-1"></a> optional<span class="op">&lt;</span>name_type<span class="op">&gt;</span> name;</span>
<span id="cb94-12"><a href="#cb94-12" aria-hidden="true" tabindex="-1"></a> optional<span class="op">&lt;</span><span class="dt">int</span><span class="op">&gt;</span> alignment;</span>
<span id="cb94-13"><a href="#cb94-13" aria-hidden="true" tabindex="-1"></a> optional<span class="op">&lt;</span><span class="dt">int</span><span class="op">&gt;</span> width;</span>
<span id="cb94-13"><a href="#cb94-13" aria-hidden="true" tabindex="-1"></a> optional<span class="op">&lt;</span><span class="dt">int</span><span class="op">&gt;</span> bit_width;</span>
<span id="cb94-14"><a href="#cb94-14" aria-hidden="true" tabindex="-1"></a> <span class="dt">bool</span> no_unique_address <span class="op">=</span> <span class="kw">false</span>;</span>
<span id="cb94-15"><a href="#cb94-15" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span>;</span>
<span id="cb94-16"><a href="#cb94-16" aria-hidden="true" tabindex="-1"></a> <span class="kw">consteval</span> <span class="kw">auto</span> data_member_spec<span class="op">(</span>info type,</span>
Expand Down Expand Up @@ -5262,10 +5262,10 @@ <h3 class="unnumbered" id="expr.prim.id.splice-splice-specifiers">7.5.4.0*
</div>
</blockquote>
</div>
<h3 class="unnumbered" id="expr.prim.id.general-general"><span>7.5.4.1
<h3 class="unnumbered" id="expr.prim.id.general-general"><span>7.5.5.1
<a href="https://wg21.link/expr.prim.id.general">[expr.prim.id.general]</a></span>
General<a href="#expr.prim.id.general-general" class="self-link"></a></h3>
<p>Add a carve-out for reflection in <span>7.5.4.1 <a href="https://wg21.link/expr.prim.id.general">[expr.prim.id.general]</a></span>/4:</p>
<p>Add a carve-out for reflection in <span>7.5.5.1 <a href="https://wg21.link/expr.prim.id.general">[expr.prim.id.general]</a></span>/4:</p>
<div class="std">
<blockquote>
<p><span class="marginalizedparent"><a class="marginalized" href="#pnum_37" id="pnum_37">4</a></span>
Expand Down Expand Up @@ -5293,7 +5293,7 @@ <h3 class="unnumbered" id="expr.prim.id.general-general"><span>7.5.4.1
</ul>
</blockquote>
</div>
<h3 class="unnumbered" id="expr.prim.id.qual-qualified-names"><span>7.5.4.3 <a href="https://wg21.link/expr.prim.id.qual">[expr.prim.id.qual]</a></span>
<h3 class="unnumbered" id="expr.prim.id.qual-qualified-names"><span>7.5.5.3 <a href="https://wg21.link/expr.prim.id.qual">[expr.prim.id.qual]</a></span>
Qualified names<a href="#expr.prim.id.qual-qualified-names" class="self-link"></a></h3>
<p>Add a production to the grammar for
<code class="sourceCode cpp"><em>nested-name-specifier</em></code> as
Expand Down Expand Up @@ -5390,7 +5390,7 @@ <h3 class="unnumbered" id="expr.prim.id.qual-qualified-names"><span>7.5.4.3 <a h
<h3 class="unnumbered" id="expr.prim.splice-expression-splicing">7.5.8*
[expr.prim.splice] Expression splicing<a href="#expr.prim.splice-expression-splicing" class="self-link"></a></h3>
<p>Add a new subsection of <span>7.5 <a href="https://wg21.link/expr.prim">[expr.prim]</a></span> following
<span>7.5.7 <a href="https://wg21.link/expr.prim.req">[expr.prim.req]</a></span></p>
<span>7.5.8 <a href="https://wg21.link/expr.prim.req">[expr.prim.req]</a></span></p>
<div class="std">
<blockquote>
<div class="addu">
Expand Down Expand Up @@ -5912,7 +5912,7 @@ <h3 class="unnumbered" id="expr.const-constant-expressions"><span>7.7 <a href="h
<a href="https://wg21.link/temp.names">[temp.names]</a></span>), or</li>
<li><span class="marginalizedparent"><a class="marginalized" href="#pnum_97" id="pnum_97">(20.3)</a></span>
in a <code class="sourceCode cpp"><em>requires-expression</em></code>
(<span>7.5.7 <a href="https://wg21.link/expr.prim.req">[expr.prim.req]</a></span>).</li>
(<span>7.5.8 <a href="https://wg21.link/expr.prim.req">[expr.prim.req]</a></span>).</li>
</ul>
<p><span class="marginalizedparent"><a class="marginalized" href="#pnum_98" id="pnum_98">21</a></span>
An expression or conversion is <em>plainly constant-evaluated</em> if it
Expand Down Expand Up @@ -7210,7 +7210,7 @@ <h3 class="unnumbered" id="meta.synop-header-meta-synopsis">[meta.synop]
<span id="cb133-176"><a href="#cb133-176" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb133-177"><a href="#cb133-177" aria-hidden="true" tabindex="-1"></a> optional&lt;name_type&gt; name;</span>
<span id="cb133-178"><a href="#cb133-178" aria-hidden="true" tabindex="-1"></a> optional&lt;int&gt; alignment;</span>
<span id="cb133-179"><a href="#cb133-179" aria-hidden="true" tabindex="-1"></a> optional&lt;int&gt; width;</span>
<span id="cb133-179"><a href="#cb133-179" aria-hidden="true" tabindex="-1"></a> optional&lt;int&gt; bit_width;</span>
<span id="cb133-180"><a href="#cb133-180" aria-hidden="true" tabindex="-1"></a> bool no_unique_address = false;</span>
<span id="cb133-181"><a href="#cb133-181" aria-hidden="true" tabindex="-1"></a> };</span>
<span id="cb133-182"><a href="#cb133-182" aria-hidden="true" tabindex="-1"></a> consteval info data_member_spec(info type,</span>
Expand Down Expand Up @@ -8811,14 +8811,14 @@ <h3 class="unnumbered" id="meta.reflection.define_aggregate-reflection-class-def
either:
<ul>
<li><span class="marginalizedparent"><a class="marginalized" href="#pnum_356" id="pnum_356">(1.2.1)</a></span>
<code class="sourceCode cpp">holds_alternative<span class="op">&lt;</span>u8string<span class="op">&gt;(</span><em>NAME</em><span class="op">)</span></code>
<code class="sourceCode cpp">holds_alternative<span class="op">&lt;</span>u8string<span class="op">&gt;(</span><em>contents</em><span class="op">)</span></code>
is <code class="sourceCode cpp"><span class="kw">true</span></code> and
<code class="sourceCode cpp">get<span class="op">&lt;</span>u8string<span class="op">&gt;(</span><em>NAME</em><span class="op">)</span></code>
<code class="sourceCode cpp">get<span class="op">&lt;</span>u8string<span class="op">&gt;(</span><em>contents</em><span class="op">)</span></code>
contains a valid identifier when interpreted with UTF-8, or</li>
<li><span class="marginalizedparent"><a class="marginalized" href="#pnum_357" id="pnum_357">(1.2.2)</a></span>
<code class="sourceCode cpp">holds_alternative<span class="op">&lt;</span>string<span class="op">&gt;(</span><em>NAME</em><span class="op">)</span></code>
<code class="sourceCode cpp">holds_alternative<span class="op">&lt;</span>string<span class="op">&gt;(</span><em>contents</em><span class="op">)</span></code>
is <code class="sourceCode cpp"><span class="kw">true</span></code> and
<code class="sourceCode cpp">get<span class="op">&lt;</span>string<span class="op">&gt;(</span><em>NAME</em><span class="op">)</span></code>
<code class="sourceCode cpp">get<span class="op">&lt;</span>string<span class="op">&gt;(</span><em>contents</em><span class="op">)</span></code>
contains a valid identifier when interpreted with the ordinary literal
encoding;</li>
</ul></li>
Expand All @@ -8828,7 +8828,7 @@ <h3 class="unnumbered" id="meta.reflection.define_aggregate-reflection-class-def
the alignment requirement of
<code class="sourceCode cpp"><em>T</em></code>; and</li>
<li><span class="marginalizedparent"><a class="marginalized" href="#pnum_359" id="pnum_359">(1.4)</a></span>
if <code class="sourceCode cpp">options<span class="op">.</span>width</code>
if <code class="sourceCode cpp">options<span class="op">.</span>bit_width</code>
contains a value <code class="sourceCode cpp"><em>V</em></code>, then
<ul>
<li><span class="marginalizedparent"><a class="marginalized" href="#pnum_360" id="pnum_360">(1.4.1)</a></span>
Expand Down Expand Up @@ -8975,7 +8975,7 @@ <h3 class="unnumbered" id="meta.reflection.define_aggregate-reflection-class-def
declared with the attribute <code class="sourceCode cpp"><span class="op">[[</span><span class="at">no_unique_address</span><span class="op">]]</span></code>.</li>
<li><span class="marginalizedparent"><a class="marginalized" href="#pnum_380" id="pnum_380">(7.7)</a></span>
Non-static data members corresponding to reflections
<code class="sourceCode cpp"><span class="math inline"><em>r</em></span><sub><span class="math inline"><em>K</em></span></sub></code> for which <code class="sourceCode cpp"><span class="math inline"><em>o</em></span><sub><span class="math inline"><em>K</em></span></sub><span class="op">.</span>width</code>
<code class="sourceCode cpp"><span class="math inline"><em>r</em></span><sub><span class="math inline"><em>K</em></span></sub></code> for which <code class="sourceCode cpp"><span class="math inline"><em>o</em></span><sub><span class="math inline"><em>K</em></span></sub><span class="op">.</span>bit_width</code>
contains a value are declared as bit-fields whose width is that
value.</li>
<li><span class="marginalizedparent"><a class="marginalized" href="#pnum_381" id="pnum_381">(7.8)</a></span>
Expand All @@ -8988,7 +8988,7 @@ <h3 class="unnumbered" id="meta.reflection.define_aggregate-reflection-class-def
<code class="sourceCode cpp"><span class="math inline"><em>r</em></span><sub><span class="math inline"><em>K</em></span></sub></code> are declared with
names determined as follows:
<ul>
<li>If <code class="sourceCode cpp"><span class="math inline"><em>o</em></span><sub><span class="math inline"><em>K</em></span></sub><span class="op">.</span>width</code>
<li>If <code class="sourceCode cpp"><span class="math inline"><em>o</em></span><sub><span class="math inline"><em>K</em></span></sub><span class="op">.</span>bit_width</code>
contains the value zero, the non-static data member is declared without
a name.</li>
<li>Otherwise, if <code class="sourceCode cpp">has_identifier<span class="op">(</span><span class="math inline"><em>r</em></span><sub><span class="math inline"><em>K</em></span></sub><span class="op">)</span></code>
Expand Down Expand Up @@ -9669,6 +9669,10 @@ <h1 data-number="6" style="border-bottom:1px solid #cccccc" id="bibliography"><s
[P3096R1] Adam Lach, Walter Genovese. 2024-05-15. Function Parameter
Reflection in Reflection for C++26. <a href="https://wg21.link/p3096r1"><div class="csl-block">https://wg21.link/p3096r1</div></a>
</div>
<div id="ref-P3293R1" class="csl-entry" role="doc-biblioentry">
[P3293R1] Barry Revzin, Peter Dimov, Dan Katz, Daveed Vandevoorde.
2024-10-13. Splicing a base class subobject. <a href="https://wg21.link/p3293r1"><div class="csl-block">https://wg21.link/p3293r1</div></a>
</div>
<div id="ref-P3295R0" class="csl-entry" role="doc-biblioentry">
[P3295R0] Ben Craig. 2024-05-21. Freestanding constexpr containers and
constexpr exception types. <a href="https://wg21.link/p3295r0"><div class="csl-block">https://wg21.link/p3295r0</div></a>
Expand Down
14 changes: 7 additions & 7 deletions 2996_reflection/reflection.md
Original file line number Diff line number Diff line change
Expand Up @@ -2687,7 +2687,7 @@ namespace std::meta {

optional<name_type> name;
optional<int> alignment;
optional<int> width;
optional<int> bit_width;
bool no_unique_address = false;
};
consteval auto data_member_spec(info type,
Expand Down Expand Up @@ -4387,7 +4387,7 @@ namespace std::meta {

optional<name_type> name;
optional<int> alignment;
optional<int> width;
optional<int> bit_width;
bool no_unique_address = false;
};
consteval info data_member_spec(info type,
Expand Down Expand Up @@ -5391,10 +5391,10 @@ consteval info data_member_spec(info type,

- [#.#]{.pnum} `type` represents either a type `cv $T$`, or a `$typedef-name$` designating a type `cv $T$`;
- [#.#]{.pnum} if `options.name.$contents$` contains a value `$NAME$` then either:
- [#.#.#]{.pnum} `holds_alternative<u8string>($NAME$)` is `true` and `get<u8string>($NAME$)` contains a valid identifier when interpreted with UTF-8, or
- [#.#.#]{.pnum} `holds_alternative<string>($NAME$)` is `true` and `get<string>($NAME$)` contains a valid identifier when interpreted with the ordinary literal encoding;
- [#.#.#]{.pnum} `holds_alternative<u8string>($contents$)` is `true` and `get<u8string>($contents$)` contains a valid identifier when interpreted with UTF-8, or
- [#.#.#]{.pnum} `holds_alternative<string>($contents$)` is `true` and `get<string>($contents$)` contains a valid identifier when interpreted with the ordinary literal encoding;
- [#.#]{.pnum} if `options.alignment` contains a value, it is an alignment value ([basic.align]) not less than the alignment requirement of `$T$`; and
- [#.#]{.pnum} if `options.width` contains a value `$V$`, then
- [#.#]{.pnum} if `options.bit_width` contains a value `$V$`, then
- [#.#.#]{.pnum} `$T$` represents an integral or enumeration type,
- [#.#.#]{.pnum} `options.alignment` does not contain a value,
- [#.#.#]{.pnum} `options.no_unique_address` is `false`, and
Expand Down Expand Up @@ -5442,10 +5442,10 @@ Produces an injected declaration `$D$` ([expr.const]) that provides a definition
- [#.#]{.pnum} `$D$` contains a public non-static data member corresponding to each reflection value `@$r$~$K$~@` in `mdescrs`. For every other `@$r$~$L$~@` in `mdescrs` such that `$K$ < $L$`, the declaration of `@$r$~$K$~@` precedes the declaration of `@$r$~$L$~@`.
- [#.#]{.pnum} The non-static data member corresponding to each `@$r$~$K$~@` is declared with the type or `$typedef-name$` represented by `@$t$~$K$~@`.
- [#.#]{.pnum} Non-static data members corresponding to reflections `@$r$~$K$~@` for which `@[email protected]_unique_address` is `true` are declared with the attribute `[[no_unique_address]]`.
- [#.#]{.pnum} Non-static data members corresponding to reflections `@$r$~$K$~@` for which `@$o$~$K$~@.width` contains a value are declared as bit-fields whose width is that value.
- [#.#]{.pnum} Non-static data members corresponding to reflections `@$r$~$K$~@` for which `@$o$~$K$~@.bit_width` contains a value are declared as bit-fields whose width is that value.
- [#.#]{.pnum} Non-static data members corresponding to reflections `@$r$~$K$~@` for which `@[email protected]` contains a value are declared with the `$alignment-specifier$` `alignas(@[email protected])`.
- [#.#]{.pnum} Non-static data members corresponding to reflections `@$r$~$K$~@` are declared with names determined as follows:
- If `@$o$~$K$~@.width` contains the value zero, the non-static data member is declared without a name.
- If `@$o$~$K$~@.bit_width` contains the value zero, the non-static data member is declared without a name.
- Otherwise, if `has_identifier(@$r$~$K$~@)` is `false`, the non-static data member is unnamed.
- Otherwise, the name of the non-static data member is the identifier determined by the character sequence encoded by `u8identifier_of(@$r$~$K$~@)` in UTF-8.
- [#.#]{.pnum} If `$C$` is a union type for which any of its members are not trivially default constructible, then it has a user-provided default constructor which has no effect.
Expand Down

0 comments on commit 8614074

Please sign in to comment.