Title
Conversion function templates and "noexcept"
Status
c++23
Section
13.10.3.4 [temp.deduct.conv]
Submitter
US

Created on 2022-11-03.00:00:00 last changed 17 months ago

Messages

Date: 2022-11-10.00:02:08

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:
  • ...
  • If the original A is a function pointer or pointer-to-member-function type with a potentially-throwing exception specification (14.5 [except.spec]), its noexcept the exception specification.
  • ...
Date: 2022-11-27.21:00:25
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>();
History
Date User Action Args
2023-07-16 13:00:43adminsetstatus: open -> c++23
2023-07-16 13:00:43adminsetstatus: drwp -> open
2023-02-18 18:43:04adminsetstatus: dr -> drwp
2022-11-25 05:14:04adminsetstatus: nb -> dr
2022-11-10 00:02:08adminsetstatus: open -> nb
2022-11-10 00:02:08adminsetstatus: open -> open
2022-11-10 00:02:08adminsetstatus: open -> open
2022-11-10 00:02:08adminsetstatus: open -> open
2022-11-08 13:55:23adminsetstatus: nb -> open
2022-11-08 13:55:23adminsetstatus: nb -> nb
2022-11-08 13:55:23adminsetstatus: nb -> nb
2022-11-08 13:55:23adminsetmessages: + msg6978
2022-11-03 00:00:00admincreate