This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 116a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-12-19


2651. Conversion function templates and "noexcept"

Section: 13.10.3.4  [temp.deduct.conv]     Status: C++23     Submitter: US     Date: 2022-11-03

P2720R0 comment US 29-069

[Accepted as a DR at the November, 2022 meeting.]

The rule in 13.10.3.4 [temp.deduct.conv] bullet 5.2 seems to allow

template<class T,bool B>
using get=T(*)() noexcept(B);

struct A {
 template<class T>
 operator get<T,false>() const;
};

auto *p=A().operator get<int,true>();

Proposed resolution (approved by CWG 2022-11-09):

Change in 13.10.3.4 [temp.deduct.conv] paragraph 1 as follows:

... If the conversion-function-id is constructed during overload resolution ([over.match.funcs]), the following transformations rules in the remainder of this subclause apply.

Change in 13.10.3.4 [temp.deduct.conv] bullet 5.2 as follows:

However, certain attributes of A may be ignored: