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

2024-04-18


1946. exception-specifications vs pointer dereference

Section: 14.5  [except.spec]     Status: CD4     Submitter: Mike Miller     Date: 2014-06-21

[Adopted at the October, 2015 meeting as P0012R1.]

The resolution of issue 1351 results in the following:

  void (*p)() throw(int);
  void (&r)() throw(int) = *p;  // ill-formed

The reason is that the set of potential exceptions for an indirection is “any” instead of maintaining the known potential exceptions of the operand. It would seem to be reasonable to propagate the set in such cases.

A similar issue arises with function template argument deduction:

  template<typename T> T& f(T* p);
  void (*p)() throw(int);
  void (&r)() throw(int) = f(p);  // ill-formed

See also issues 2010, 1995, 1975, and 1798.

Additional note, May, 2015:

See also issue 92 and EWG issue 169.