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


1798. exception-specifications of template arguments

Section: 14.5  [except.spec]     Status: NAD     Submitter: Gabriel Dos Reis     Date: 2013-10-16

Although 14.5 [except.spec] paragraphs 5-6 require that overriding a virtual function and initializing or assigning to a function pointer not weaken exception-specifications, the same is not true of providing a template argument for a template parameter. For example,

  template<void (*FP)() noexcept> void x() { }
  void f() noexcept(false);
  template void x<f>();

is currently well-formed, which seems inconsistent. (Note that if exception-specifications become part of the type system, as proposed in issue 92, this issue will become moot.)

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

Rationale (February, 2014):

Are template declarations that differ only in the exception-specification of the parameter redeclarations or separate templates distinguished, presumably, by deduction failure? This seems like a question more appropriate for consideration by EWG.

Additional note, April, 2015:

EWG has decided not to make a change in this area. See EWG issue 133.