Skip to content

Commit

Permalink
is_noexcept should be based on non-throwing exception specification
Browse files Browse the repository at this point in the history
  • Loading branch information
brevzin committed Nov 19, 2024
1 parent 3fdc1f4 commit 38cd4f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 2 additions & 5 deletions 2996_reflection/p2996r8.html
Original file line number Diff line number Diff line change
Expand Up @@ -8693,16 +8693,13 @@ <h3 class="unnumbered" id="meta.reflection.queries-reflection-queries">[meta.ref
because in general such queries for templates cannot be answered.<span>
— <em>end note</em> ]</span></span></p>
<div class="sourceCode" id="cb154"><pre class="sourceCode cpp"><code class="sourceCode cpp"><span id="cb154-1"><a href="#cb154-1" aria-hidden="true" tabindex="-1"></a><span class="kw">consteval</span> <span class="dt">bool</span> is_noexcept<span class="op">(</span>info r<span class="op">)</span>;</span></code></pre></div>
<p>FIXME: this needs to talk about potentially throwing,
https://eel.is/c++draft/except.spec#1.sentence-2</p>
<p><span class="marginalizedparent"><a class="marginalized" href="#pnum_280" id="pnum_280">8</a></span>
<em>Returns</em>:
<code class="sourceCode cpp"><span class="kw">true</span></code> if
<code class="sourceCode cpp">r</code> represents a
<code class="sourceCode cpp"><span class="kw">noexcept</span></code>
function type or a function or member function that is declared
<code class="sourceCode cpp"><span class="kw">noexcept</span></code>.
Otherwise,
function type or a function or member function with a non-throwing
exception specification ([except.spec]). Otherwise,
<code class="sourceCode cpp"><span class="kw">false</span></code>. <span class="note"><span>[ <em>Note 2:</em> </span>If
<code class="sourceCode cpp">r</code> represents a function template
that is declared
Expand Down
4 changes: 1 addition & 3 deletions 2996_reflection/reflection.md
Original file line number Diff line number Diff line change
Expand Up @@ -5086,9 +5086,7 @@ consteval bool is_explicit(info r);
consteval bool is_noexcept(info r);
```

FIXME: this needs to talk about potentially throwing, https://eel.is/c++draft/except.spec#1.sentence-2

[#]{.pnum} *Returns*: `true` if `r` represents a `noexcept` function type or a function or member function that is declared `noexcept`. Otherwise, `false`. [If `r` represents a function template that is declared `noexcept`, `is_noexcept(r)` is still `false` because in general such queries for templates cannot be answered.]{.note}
[#]{.pnum} *Returns*: `true` if `r` represents a `noexcept` function type or a function or member function with a non-throwing exception specification ([except.spec]). Otherwise, `false`. [If `r` represents a function template that is declared `noexcept`, `is_noexcept(r)` is still `false` because in general such queries for templates cannot be answered.]{.note}

```cpp
consteval bool is_bit_field(info r);
Expand Down

0 comments on commit 38cd4f8

Please sign in to comment.