<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 973</TITLE>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<STYLE TYPE="text/css">
  INS { text-decoration:none; font-weight:bold; background-color:#A0FFA0 }
  .INS { text-decoration:none; background-color:#D0FFD0 }
  DEL { text-decoration:line-through; background-color:#FFA0A0 }
  .DEL { text-decoration:line-through; background-color: #FFD0D0 }
  @media (prefers-color-scheme: dark) {
    HTML { background-color:#202020; color:#f0f0f0; }
    A { color:#5bc0ff; }
    A:visited { color:#c6a8ff; }
    A:hover, a:focus { color:#afd7ff; }
    INS { background-color:#033a16; color:#aff5b4; }
    .INS { background-color: #033a16; }
    DEL { background-color:#67060c; color:#ffdcd7; }
    .DEL { background-color:#67060c; }
  }
  SPAN.cmnt { font-family:Times; font-style:italic }
</STYLE>
</HEAD>
<BODY>
<P><EM>This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21
  Core Issues List revision 118b.
  See http://www.open-std.org/jtc1/sc22/wg21/ for the official
  list.</EM></P>
<P>2025-09-28</P>
<HR>
<A NAME="973"></A><H4>973.
  
Function types in <I>exception-specification</I>s
</H4>
<B>Section: </B>14.5&#160; [<A href="https://wg21.link/except.spec">except.spec</A>]
 &#160;&#160;&#160;

 <B>Status: </B>CD2
 &#160;&#160;&#160;

 <B>Submitter: </B>Daniel Kr&#252;gler
 &#160;&#160;&#160;

 <B>Date: </B>12 October, 2009<BR>


<P>[Voted into WP at March, 2010 meeting.]</P>

<P>There is no prohibition against specifying a function type in an
<I>exception-specification</I>, and the normal conversion of a
function type to a pointer-to-function type occurs in both
<I>throw-expression</I>s (14.2 [<A href="https://wg21.link/except.throw#3">except.throw</A>] paragraph 3) and
in <I>handler</I>s (14.4 [<A href="https://wg21.link/except.handle#2">except.handle</A>] paragraph 2), but that
was apparently overlooked in the description of
<I>exception-specification</I>s.</P>

<P><B>Proposed resolution (February, 2010):</B></P>

<P>Change 14.5 [<A href="https://wg21.link/except.spec">except.spec</A>] paragraphs 2-3 as follows:</P>

<BLOCKQUOTE>

<P>A type denoted in an <I>exception-specification</I> shall not
denote an incomplete type.  A type denoted in an
<I>exception-specification</I> shall not denote a pointer or
reference to an incomplete type, other than <TT>void*</TT>,
<TT>const void*</TT>, <TT>volatile void*</TT>, or <TT>const
volatile void*</TT>. <INS>A type <I>cv</I> <TT>T</TT>,
&#8220;array of <TT>T</TT>,&#8221; or &#8220;function returning
<TT>T</TT>&#8221; denoted in an <I>exception-specification</I> is
adjusted to type <TT>T</TT>, &#8220;pointer to <TT>T</TT>,&#8221;
or &#8220;pointer to function returning <TT>T</TT>,&#8221;
respectively.</INS>
</P>

<P>If any declaration of a function has an
<I>exception-specification</I>, all declarations, including the
definition and <DEL>an</DEL> <INS>any</INS> explicit
specialization, of that function shall have an
<I>exception-specification</I> with the same set of
<DEL><I>type-id</I>s</DEL> <INS>adjusted types</INS>.  If any
declaration of a pointer to function, reference to function, or
pointer to member function has an <I>exception-specification</I>,
all occurrences of that declaration shall have an
<I>exception-specification</I> with the same set of
<DEL><I>type-id</I>s</DEL> <INS>adjusted types</INS>.  In an
explicit instantiation an <I>exception-specification</I> may be
specified, but is not required. If an
<I>exception-specification</I> is specified in an explicit
instantiation directive, it shall have the same set of
<DEL><I>type-id</I>s</DEL> <INS>adjusted types</INS> as other
declarations of that function. A diagnostic is required only if
the sets of <DEL><I>type-id</I>s</DEL> <INS>adjusted types</INS>
are different within a single translation unit.</P>

</BLOCKQUOTE>

<BR><BR>
</BODY>
</HTML>
