Skip to content

Commit 45c3677

Browse files
committed
New issues from Tomasz: "CTAD function_ref of data member pointer should produce noexcept signature"
1 parent 4ebe8b3 commit 45c3677

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

xml/issue4425.xml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?xml version='1.0' encoding='utf-8' standalone='no'?>
2+
<!DOCTYPE issue SYSTEM "lwg-issue.dtd">
3+
4+
<issue num="4425" status="New">
5+
<title>CTAD <tt>function_ref</tt> of data member pointer should produce <tt>noexcept</tt> signature</title>
6+
<section><sref ref="[func.wrap.ref.deduct]"/></section>
7+
<submitter>Tomasz Kami&nacute;ski</submitter>
8+
<date>20 Oct 2025</date>
9+
<priority>99</priority>
10+
11+
<discussion>
12+
<b>Addresses PL-005.</b>
13+
14+
<p>
15+
For data member pointer <tt>M C::* dmp</tt>, template argument deduction in form
16+
<tt>std::function_ref fr(std::nontype&lt;dmp&gt;, x)</tt> results in
17+
<tt>std::function_ref&lt;M&amp;()&gt;</tt>, that returns a reference to designated
18+
member. As accessing a data member can never throw exception and <tt>function_ref</tt>
19+
support <tt>noexcept</tt> qualifed function types, the deduction guide should be
20+
updated to produce <tt>noexcept</tt>-qualified signature.</p>
21+
22+
</discussion>
23+
24+
<resolution>
25+
<p>
26+
This wording is relative to <paper num="N5014"/>.
27+
</p>
28+
<ol>
29+
30+
<li><p>Modify <sref ref="[func.wrap.ref.deduct]"/> as indicated:</p>
31+
32+
<blockquote>
33+
<pre>
34+
template&lt;class F&gt;
35+
function_ref(nontype_t&lt;f&gt;, T&amp;&amp;) -> function_ref&lt;<i>see below</i>&gt;;
36+
</pre>
37+
<blockquote>
38+
<p>Let <tt>F</tt> be <tt>decltype(f)</tt>.</p>
39+
40+
<p>
41+
-6- <i>Constraint</i>:
42+
<ol style="list-style-type:none">
43+
<li>(6.1) &mdash; <tt>F</tt> is of the form
44+
<tt>R(G::*)(A...) <it>cv</it> &amp;<sub>opt</sub> noexcept(E)</tt> for type <tt>G</tt>, or</li>
45+
<li>(6.2) &mdash; <tt>F</tt> is of the form <tt>M G::*</tt> for type <tt>G</tt> and
46+
object type <tt>M</tt>, in which case let <tt>R</tt> be <tt>invoke_result_t&lt;F, T&amp;&gt;</tt>,
47+
<tt>A...</tt> be an empty pack, and <tt>E</tt> be <del><tt>false</tt></del>
48+
<ins><tt>true</tt></ins>, or</li>
49+
<li>(6.3) &mdash; <tt>F</tt> is of the form
50+
<tt>R(*)(G, A...) noexcept(E)</tt> for type <tt>G</tt>.</li>
51+
</ol>
52+
</p>
53+
54+
<p>
55+
-7- <i>Remarks</i>: The deduced type is <tt>function_ref&lt;R(A...) noexcept(E)&gt;</tt>.
56+
</p>
57+
58+
</blockquote>
59+
</blockquote>
60+
61+
</li>
62+
</ol>
63+
64+
65+
</resolution>
66+
67+
</issue>

0 commit comments

Comments
 (0)