This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 112e. See for the official list.


2651. Conversion function templates and "noexcept"

Section:  [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 [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 [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 [temp.deduct.conv] bullet 5.2 as follows:

However, certain attributes of A may be ignored: