Skip to content

Commit af5e38f

Browse files
committed
New issue from Jiang An: "§[const.wrap.class] "operator decltype(auto)" is ill-formed"
1 parent 2859433 commit af5e38f

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

xml/issue4468.xml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?xml version='1.0' encoding='utf-8' standalone='no'?>
2+
<!DOCTYPE issue SYSTEM "lwg-issue.dtd">
3+
4+
<issue num="4468" status="New">
5+
<title>&sect;[const.wrap.class] "`operator decltype(auto)`" is ill-formed</title>
6+
<section><sref ref="[const.wrap.class]"/></section>
7+
<submitter>Jiang An</submitter>
8+
<date>07 Nov 2025</date>
9+
<priority>99</priority>
10+
11+
<discussion>
12+
<p>
13+
Following the approval of <a href="https://wg21.link/cwg1670">CWG 1670</a> in Kona 2025, the
14+
following declaration in class template `constant_wrapper`, <sref ref="[const.wrap.class]"/>,
15+
is ill-formed:
16+
</p>
17+
<blockquote><pre>
18+
constexpr operator decltype(auto)() const noexcept { return value; }
19+
</pre></blockquote>
20+
</discussion>
21+
22+
<resolution>
23+
<p>
24+
This wording is relative to <paper num="N5014"/>.
25+
</p>
26+
27+
<ol>
28+
<li><p>Modify <sref ref="[const.wrap.class]"/>, class template `constant_wrapper`synopsis, as indicated:</p>
29+
30+
<blockquote>
31+
<pre>
32+
[&hellip;]
33+
template&lt;<i>cw-fixed-value</i> X, class>
34+
struct constant_wrapper : <i>cw-operators</i> {
35+
static constexpr const auto &amp; value = X.<i>data</i>;
36+
37+
using type = constant_wrapper;
38+
using value_type = typename decltype(X)::<i>type</i>;
39+
40+
[&hellip;]
41+
constexpr operator decltype(<del>auto</del><ins>value</ins>)() const noexcept { return value; }
42+
};
43+
</pre>
44+
</blockquote>
45+
</li>
46+
</ol>
47+
48+
</resolution>
49+
50+
</issue>

0 commit comments

Comments
 (0)