cplusplus / nbballot

Handling of NB comments in response to ballots
14 stars 4 forks source link

US 29-069 13.10.3.4p5.2 [temp.deduct.conv] Conversion function templates and "noexcept" #501

Closed wg21bot closed 1 year ago

wg21bot commented 1 year ago

This rule 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>();

with p not being noexcept.

Proposed change:

Allow the original A to be (perhaps implicitly) noexcept(false) rather than allowing it and not P to be noexcept(true).

jensmaurer commented 1 year ago

CWG2651

jensmaurer commented 1 year ago

Accept with modifications. See CWG2651 for details.