File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed
Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change 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 >§ [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+ [… ]
33+ template< <i >cw-fixed-value</i > X, class>
34+ struct constant_wrapper : <i >cw-operators</i > {
35+ static constexpr const auto & value = X.<i >data</i >;
36+
37+ using type = constant_wrapper;
38+ using value_type = typename decltype(X)::<i >type</i >;
39+
40+ [… ]
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 >
You can’t perform that action at this time.
0 commit comments