<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 1130</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="1130"></A><H4>1130.
  
Function parameter type adjustments and <TT>decltype</TT>
</H4>
<B>Section: </B>9.2.9.3&#160; [<A href="https://wg21.link/dcl.type.simple">dcl.type.simple</A>]
 &#160;&#160;&#160;

 <B>Status: </B>C++11
 &#160;&#160;&#160;

 <B>Submitter: </B>US
 &#160;&#160;&#160;

 <B>Date: </B>2010-08-02<BR><BR>


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

<A href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3296.html#US40">N3092 comment
  US&#160;40<BR></A>

<P>The description of <TT>decltype</TT> does not specify whether the
type of a parameter is the declared type or the type as
adjusted in 9.3.4.6 [<A href="https://wg21.link/dcl.fct#5">dcl.fct</A>] paragraph 5:</P>

<PRE>
    auto f(int a[])-&gt;decltype(a);     // ill-formed or int*?
    auto g(const int i)-&gt;decltype(i); // int or const int?
</PRE>

<P>
<U>Suggested resolution</U>: Clarify the wording to
indicate that the type of a parameter is after the array-
and function-to-pointer decay but before the removal of
cv-qualification.</P>

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

<P>Change 9.3.4.6 [<A href="https://wg21.link/dcl.fct#5">dcl.fct</A>] paragraph 5 as follows:</P>

<BLOCKQUOTE>

...After producing the list of parameter types, <DEL>several
transformations take place upon these types to determine the
function type.  Any</DEL> <INS>any top-level</INS>
<I>cv-qualifier</I><INS>s</INS> modifying a parameter type
<DEL>is</DEL> <INS>are</INS> deleted <INS>when forming the
function type</INS>. <DEL>[<I>Example:</I> the type
<TT>void(*)(const int)</TT> becomes <TT>void(*)(int)</TT>
&#8212;<I>end example</I>] Such
<I>cv-qualifier</I>s affect only the definition of the
parameter within the body of the function; they do not
affect the function type. If a
<I>storage-class-specifier</I> modifies a parameter type,
the specifier is deleted. [<I>Example:</I> <TT>register
char*</TT> becomes <TT>char*</TT> &#8212;<I>end example</I>]
Such <I>storage-class-specifier</I>s affect only the definition of
the parameter within the body of the function; they do not
affect the function type.</DEL> The resulting list of transformed
parameter types and the presence or absence of the ellipsis
or a function parameter pack is the function's
<I>parameter-type-list</I>. <INS>[<I>Note:</I> This
transformation does not affect the types of the parameters.
For example, <TT>int(*)(const int p, decltype(p)*)</TT> and
<TT>int(*)(int, const int*)</TT> are identical types.
&#8212;<I>end note</I>]</INS>

</BLOCKQUOTE>

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