<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 2465: SFINAE-friendly common_type is nearly impossible to specialize
correctly and regresses key functionality</title>
<meta property="og:title" content="Issue 2465: SFINAE-friendly common_type is nearly impossible to specialize
correctly and regresses key functionality">
<meta property="og:description" content="C++ library issue. Status: Resolved">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue2465.html">
<meta property="og:type" content="website">
<meta property="og:image" content="http://cplusplus.github.io/LWG/images/cpp_logo.png">
<meta property="og:image:alt" content="C++ logo">
<style>
  p {text-align:justify}
  li {text-align:justify}
  pre code.backtick::before { content: "`" }
  pre code.backtick::after { content: "`" }
  blockquote.note
  {
    background-color:#E0E0E0;
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 1px;
    padding-bottom: 1px;
  }
  ins {background-color:#A0FFA0}
  del {background-color:#FFA0A0}
  table.issues-index { border: 1px solid; border-collapse: collapse; }
  table.issues-index th { text-align: center; padding: 4px; border: 1px solid; }
  table.issues-index td { padding: 4px; border: 1px solid; }
  table.issues-index td:nth-child(1) { text-align: right; }
  table.issues-index td:nth-child(2) { text-align: left; }
  table.issues-index td:nth-child(3) { text-align: left; }
  table.issues-index td:nth-child(4) { text-align: left; }
  table.issues-index td:nth-child(5) { text-align: center; }
  table.issues-index td:nth-child(6) { text-align: center; }
  table.issues-index td:nth-child(7) { text-align: left; }
  table.issues-index td:nth-child(5) span.no-pr { color: red; }
  @media (prefers-color-scheme: dark) {
     html {
        color: #ddd;
        background-color: black;
     }
     ins {
        background-color: #225522
     }
     del {
        background-color: #662222
     }
     a {
        color: #6af
     }
     a:visited {
        color: #6af
     }
     blockquote.note
     {
        background-color: rgba(255, 255, 255, .10)
     }
  }
</style>
</head>
<body>
<hr>
<p><em>This page is a snapshot from the LWG issues list, see the <a href="lwg-active.html">Library Active Issues List</a> for more information and the meaning of <a href="lwg-active.html#Resolved">Resolved</a> status.</em></p>
<h3 id="2465"><a href="lwg-defects.html#2465">2465</a>. SFINAE-friendly <code>common_type</code> is nearly impossible to specialize
correctly and regresses key functionality</h3>
<p><b>Section:</b> 21.3.9.7 <a href="https://wg21.link/meta.trans.other">[meta.trans.other]</a> <b>Status:</b> <a href="lwg-active.html#Resolved">Resolved</a>
 <b>Submitter:</b> Eric Niebler <b>Opened:</b> 2015-01-12 <b>Last modified:</b> 2017-09-07</p>
<p><b>Priority: </b>2
</p>
<p><b>View all other</b> <a href="lwg-index.html#meta.trans.other">issues</a> in [meta.trans.other].</p>
<p><b>View all issues with</b> <a href="lwg-status.html#Resolved">Resolved</a> status.</p>
<p><b>Discussion:</b></p>
<p>
I think there's a defect regarding <code>common_type</code> and its specializations.
Unless I've missed it, there is nothing preventing folks from
instantiating <code>common_type</code> with <i>cv</i>-qualified types or reference types. In
fact, the wording in N3797 explicitly mentions <i>cv</i> <code>void</code>, so presumably at
least <i>cv</i> qualifications are allowed.
<p/>
Users are given license to specialize <code>common_type</code> when at least of of
the types is user-defined. (A separate issue is the meaning of
user-defined. In core, I believe this is any class/struct/union/enum,
but in lib, I think it means any type not defined in std, right?) There
is at least one place in the standard that specializes <code>common_type</code>
(time.traits.specializations) on time_point and duration. But the
specializations are only for non-<i>cv</i>-qualified and non-reference
specializations of <code>time_point</code> and <code>duration</code>.
<p/>
If the user uses, say, <code>common_type&lt;duration&lt;X,Y&gt; const, duration&lt;A,B&gt;
const&gt;</code>, they're not going to get the behavior they expect.
<p/>
Suggest we clarify the requirements of <code>common_type</code>'s template
parameters. Also, perhaps we can add blanket wording that <code>common_type&lt;A
[<i>cv</i>][&amp;], B [<i>cv</i>][&amp;]&gt;</code> is required to be equivalent to 
<code>common_type&lt;A,B&gt;</code> (if that is in fact the way we intent this to work).
<p/>
Also, the change to make <code>common_type</code> SFINAE-friendly regressed key
functionality, as noted by Agust&iacute;n K-ballo Berg&eacute; in 
<a href="http://listarchives.isocpp.org/cgi-bin/wg21/message?wg=lib&amp;msg=37178">c++std-lib-37178</a>.
Since <code>decay_t</code> is not applied until the very end of the type computation,
user specializations are very likely to to be found.
<p/>
Agust&iacute;n says:
</p>
<blockquote class="note">
<p>
Consider the following snippet:
</p>
<blockquote>
<pre>
struct X {};
struct Y { explicit Y(X){} };

namespace std {
  template&lt;> struct common_type&lt;X, Y> { typedef Y type; };
  template&lt;> struct common_type&lt;Y, X> { typedef Y type; };
}

static_assert(is_same&lt;common_type_t&lt;X, Y>, Y>()); // (A)
static_assert(is_same&lt;common_type_t&lt;X, Y, Y>, Y>()); // (B)
static_assert(is_same&lt;common_type_t&lt;X, X, Y>, Y>()); // (C)
</pre>
</blockquote>
<p>
Under the original wording, all three assertion holds. Under the current wording,
</p>
<ul>
<li><p>(A) picks the user-defined specialization, so the assertion holds.</p></li>

<li><p>(B) goes to the third bullet and, ignoring the user-defined specialization, looks for 
<code>decltype(true ? declval&lt;X&gt;() : declval&lt;Y&gt;())</code>; since it is ill-formed 
there is no common type.</p></li>

<li><p>(C) goes to the third bullet and yields <code>common_type_t&lt;X&amp;&amp;, Y&gt;</code>, which again misses 
the user-defined specialization.</p></li>
</ul>
</blockquote>
<p>
The discussion following <a href="http://listarchives.isocpp.org/cgi-bin/wg21/message?wg=lib&amp;msg=35636">c++std-lib-35636</a> 
seemed to cohere around the idea that the primary <code>common_type</code> specialization should have the effect
of stripping top-level ref and <i>cv</i> qualifiers by applying <code>std::decay_t</code> to its arguments and, 
if any of them change as a result of that transformation, re-dispatching to <code>common_type</code> on those transformed
arguments, thereby picking up any user-defined specializations. This change to <code>common_type</code> would make 
the specializations in time.traits.specializations sufficient.
<p/>
<b>Suggested wording</b>:
<p/>
I'm afraid I don't know enough to suggest wording. But for exposition,
the following is my best shot at implementing the suggested resolution.
I believe it also fixes the regression noted by Agust&iacute;n K-ballo Berg&eacute; in
<a href="http://listarchives.isocpp.org/cgi-bin/wg21/message?wg=lib&amp;msg=37178">c++std-lib-37178</a>.
</p>
<blockquote>
<pre>
namespace detail
{
    template&lt;typename T, typename U&gt;
    using default_common_t =
        decltype(true? std::declval&lt;T&gt;() : std::declval&lt;U&gt;());

    template&lt;typename T, typename U, typename Enable = void&gt;
    struct common_type_if
    {};

    template&lt;typename T, typename U&gt;
    struct common_type_if&lt;T, U,
      void_t&lt;default_common_t&lt;T, U&gt;&gt;&gt;
    {
      using type = decay_t&lt;default_common_t&lt;T, U&gt;&gt;;
    };

    template&lt;typename T, typename U,
       typename TT = decay_t&lt;T&gt;, typename UU = decay_t&lt;U&gt;&gt;
    struct common_type2
      : common_type&lt;TT, UU&gt; // Recurse to catch user specializations
    {};

    template&lt;typename T, typename U&gt;
    struct common_type2&lt;T, U, T, U&gt;
      : common_type_if&lt;T, U&gt;
    {};

    template&lt;typename Meta, typename Enable = void&gt;
    struct has_type
      : std::false_type
    {};

    template&lt;typename Meta&gt;
    struct has_type&lt;Meta, void_t&lt;typename Meta::type&gt;&gt;
      : std::true_type
    {};

    template&lt;typename Meta, typename...Ts&gt;
    struct common_type_recurse
      : common_type&lt;typename Meta::type, Ts...&gt;
    {};

    template&lt;typename Meta, typename...Ts&gt;
    struct common_type_recurse_if
      : std::conditional&lt;
          has_type&lt;Meta>::value,
          common_type_recurse&lt;Meta, Ts...&gt;,
          empty
        >::type
    {};
}

template&lt;typename ...Ts&gt;
struct common_type
{};

template&lt;typename T>
struct common_type&lt;T>
{
  using type = std::decay_t&lt;T&gt;;
};

template&lt;typename T, typename U&gt;
struct common_type&lt;T, U&gt;
  : detail::common_type2&lt;T, U&gt;
{};

template&lt;typename T, typename U, typename... Vs&gt;
struct common_type&lt;T, U, Vs...&gt;
  : detail::common_type_recurse_if&lt;common_type&lt;T, U&gt;, Vs...&gt;
{};
</pre>
</blockquote>
<p><i>[2016-08 Chicago]</i></p>

<p>Walter and Nevin provide wording.</p>

<p><strong>Previous resolution [SUPERSEDED]:</strong></p>
<blockquote class="note">
<p><i>[This also resolves the first part of <a href="lwg-defects.html#2460" title="LWG issue 2408 and value categories (Status: C++17)">2460</a><sup><a href="https://cplusplus.github.io/LWG/issue2460" title="Latest snapshot">(i)</a></sup>]</i></p>


<p>In Table 46 of N4604, entry for <code>common_type</code>:</p>

<blockquote><p>
... may specialize this trait if at least one template parameter in the specialization is a user-defined type <ins>and no template parameter is cv-qualified</ins>.
</p></blockquote>

<p>In [meta.trans.other] bullet 3.3:</p>

<blockquote><p>
... whose second operand is an xvalue of type <del><code>T1</code></del><ins><code>decay_t&lt;T1&gt;</code></ins>, and whose third operand is an xvalue of type <del><code>T2</code></del><ins><code>decay_t&lt;T2&gt;</code></ins>.  If ...
</p></blockquote>
</blockquote>

<p><i>[2016-08-02, Chicago: Walt, Nevin, Rob, and Hal provide revised wording]</i></p>


<p><strong>Previous resolution [SUPERSEDED]:</strong></p>
<blockquote class="note">
<p>
This wording is relative to N4606.
</p>

<p><i>[This also resolves the first part of LWG <a href="lwg-defects.html#2460" title="LWG issue 2408 and value categories (Status: C++17)">2460</a><sup><a href="https://cplusplus.github.io/LWG/issue2460" title="Latest snapshot">(i)</a></sup>]</i></p>


<ol>
<li><p>In Table 46 &mdash; "Other transformations" edit the entry for <code>common_type</code>:</p>

<blockquote>
<table border="1">
<caption>Table 46 &mdash; Other transformations</caption>
<tr>
<th align="center">Template</th>
<th align="center">Comments</th>
</tr>

<tr>
<td colspan="2" align="center">
<code>&hellip;</code>
</td>
</tr>

<tr>
<td>
<code>template &lt;class... T&gt;<br/>
struct common_type;</code>
</td>

<td>
The member typedef <code>type</code> shall be defined or omitted as specified below.<br/>
If it is omitted, there shall be no member <code>type</code>. All types in the<br/>
parameter pack <code>T</code> shall be complete or (possibly <i>cv</i>) <code>void</code>.<br/> 
A program may specialize this trait <ins>for two <i>cv</i>-unqualified non-reference types</ins><br/> 
if at least one <del>template parameter in the specialization</del><ins>of them</ins><br/> 
is a user-defined type. [<i>Note:</i> Such specializations are<br/>
needed when only explicit conversions are desired among the template<br/>
arguments. &mdash; <i>end note</i>]
</td>
</tr>

<tr>
<td colspan="2" align="center">
<code>&hellip;</code>
</td>
</tr>

</table>
</blockquote>
</li>

<li><p>Edit 21.3.9.7 <a href="https://wg21.link/meta.trans.other">[meta.trans.other]</a> p3 (and its subbullets) as shown below</p>

<blockquote>
<p>
For the <code>common_type</code> trait applied to a parameter pack <code>T</code> of types, the member <code>type</code> 
shall be either defined or not present as follows:
</p>
<ul>
<li><p>If <code>sizeof...(T)</code> is zero, there shall be no member <code>type</code>.</p></li>
<li><p>If <code>sizeof...(T)</code> is one, let <code>T0</code> denote the sole type in the pack <code>T</code>. 
The member typedef <code>type</code> shall denote the same type as <code>decay_t&lt;T0&gt;</code>.</p></li>
<li><p><ins>If <code>sizeof...(T)</code> is two, let <code>T1</code> and <code>T2</code>, respectively,
denote the first and second types comprising <code>T</code>, and let <code>D1</code> and <code>D2</code>, 
respectively, denote <code>decay_t&lt;T1&gt;</code> and <code>decay_t&lt;T2&gt;</code>.</ins></p>
<ul>
<li><p><ins>If <code>is_same_v&lt;T1, D1&gt;</code>
and <code>is_same_v&lt;T2, D2&gt;</code>,
and if there is no specialization
<code>common_type&lt;T1, T2&gt;</code>,
let <code>C</code> denote the type, if any,
of an unevaluated conditional expression (7.6.16 <a href="https://wg21.link/expr.cond">[expr.cond]</a>)
whose first operand is an arbitrary value of type <code>bool</code>,
whose second operand is an xvalue of type <code>D1</code>,
and whose third operand is an xvalue of type <code>D2</code>.
If there is such a type <code>C</code>,
the member typedef <code>type</code>
shall denote <code>C</code>.
Otherwise, there shall be no member <code>type</code>.</ins></p></li>
<li><p><ins>If <code>not is_same_v&lt;T1, D1&gt;</code>
or <code>not is_same_v&lt;T2, D2&gt;</code>,
the member typedef <code>type</code>
shall denote the same type, if any, as <code>common_type_t&lt;D1, D2&gt;</code>.
Otherwise, there shall be no member <code>type</code>.</ins></p></li>
</ul>
</li>
<li><p>If <code>sizeof...(T)</code> is greater than <del>one</del><ins>two</ins>, let <code>T1</code>, <code>T2</code>, and <code>R</code>, 
respectively, denote the first, second, and (pack of) remaining types comprising <code>T</code>. 
<del>[<i>Note:</i> <code>sizeof...(R)</code> may be zero. &mdash; <i>end note</i>] Let <code>C</code> denote the
type, if any, of an unevaluated conditional expression (7.6.16 <a href="https://wg21.link/expr.cond">[expr.cond]</a>) whose first operand is an arbitrary value
of type <code>bool</code>, whose second operand is an xvalue of type <code>T1</code>, and whose third operand is 
an xvalue of type <code>T2</code>.</del> <ins>Let <code>C</code> denote <code>common_type_t&lt;T1, T2&gt;</code>.</ins> 
If there is such a type <code>C</code>, the member typedef <code>type</code> 
shall denote the same type, if any, as <code>common_type_t&lt;C, R...&gt;</code>. Otherwise, there shall 
be no member <code>type</code>.</p></li>
</ul>
</blockquote>
</li>
</ol>
</blockquote>

<p><i>[2016-08-03 Chicago LWG]</i></p>

<p>
LWG asks for minor wording tweaks and for an added Note.
Walter revises the Proposed Resolution accordingly.
</p>

<p><strong>Previous resolution [SUPERSEDED]:</strong></p>
<blockquote class="note">
<p>
This wording is relative to N4606.
</p>

<p><i>[This also resolves the first part of LWG <a href="lwg-defects.html#2460" title="LWG issue 2408 and value categories (Status: C++17)">2460</a><sup><a href="https://cplusplus.github.io/LWG/issue2460" title="Latest snapshot">(i)</a></sup>]</i></p>


<ol>
<li><p>In Table 46 &mdash; "Other transformations" edit the entry for <code>common_type</code>:</p>

<blockquote>
<table border="1">
<caption>Table 46 &mdash; Other transformations</caption>
<tr>
<th align="center">Template</th>
<th align="center">Comments</th>
</tr>

<tr>
<td colspan="2" align="center">
<code>&hellip;</code>
</td>
</tr>

<tr>
<td>
<code>template &lt;class... T&gt;<br/>
struct common_type;</code>
</td>

<td>
The member typedef <code>type</code> shall be defined or omitted as specified below.<br/>
If it is omitted, there shall be no member <code>type</code>. All types in the<br/>
parameter pack <code>T</code> shall be complete or (possibly <i>cv</i>) <code>void</code>.<br/> 
A program may specialize this trait <ins>for two <i>cv</i>-unqualified non-reference types</ins><br/> 
if at least one <del>template parameter in the specialization</del><ins>of them</ins><br/> 
is a user-defined type. [<i>Note:</i> Such specializations are<br/>
needed when only explicit conversions are desired among the template<br/>
arguments. &mdash; <i>end note</i>]
</td>
</tr>

<tr>
<td colspan="2" align="center">
<code>&hellip;</code>
</td>
</tr>

</table>
</blockquote>
</li>

<li><p>Edit 21.3.9.7 <a href="https://wg21.link/meta.trans.other">[meta.trans.other]</a> p3 (and its subbullets) as shown below</p>

<blockquote>
<p>
For the <code>common_type</code> trait applied to a parameter pack <code>T</code> of types, the member <code>type</code> 
shall be either defined or not present as follows:
</p>
<ol style="list-style-type: none">
<li><p>(3.1) &mdash; If <code>sizeof...(T)</code> is zero, there shall be no member <code>type</code>.</p></li>
<li><p>(3.2) &mdash; If <code>sizeof...(T)</code> is one, let <code>T0</code> denote the sole type in the pack <code>T</code>. 
The member typedef <code>type</code> shall denote the same type as <code>decay_t&lt;T0&gt;</code>.</p></li>
<li><p>(3.3) &mdash; <ins>If <code>sizeof...(T)</code> is two, let <code>T1</code> and <code>T2</code>, respectively,
denote the first and second types comprising <code>T</code>, and let <code>D1</code> and <code>D2</code>, 
respectively, denote <code>decay_t&lt;T1&gt;</code> and <code>decay_t&lt;T2&gt;</code>.</ins></p>
<ol style="list-style-type: none">
<li><p>(3.3.1) &mdash; <ins>If <code>is_same_v&lt;T1, D1&gt;</code> and <code>is_same_v&lt;T2, D2&gt;</code>,
let <code>C</code> denote the type of an unevaluated conditional expression (7.6.16 <a href="https://wg21.link/expr.cond">[expr.cond]</a>)
whose first operand is an arbitrary value of type <code>bool</code>,
whose second operand is an xvalue of type <code>D1</code>,
and whose third operand is an xvalue of type <code>D2</code>.
[<i>Note:</i> This will not apply if there is a specialization <code>common_type&lt;D1, D2&gt;</code>. &mdash; 
<i>end note</i>]</ins></p></li>
<li><p>(3.3.2) &mdash; <ins>Otherwise, let <code>C</code> denote the type
<code>common_type_t&lt;D1, D2&gt;</code>.</ins></p></li>
</ol>
<p><ins> In either case, if there is such a type <code>C</code>,
the member typedef <code>type</code> shall denote <code>C</code>.
Otherwise, there shall be no member <code>type</code>.</ins></p>
</li>
<li><p>(3.4) &mdash; If <code>sizeof...(T)</code> is greater than <del>one</del><ins>two</ins>, let <code>T1</code>, <code>T2</code>, and <code>R</code>, 
respectively, denote the first, second, and (pack of) remaining types comprising <code>T</code>. 
<del>[<i>Note:</i> <code>sizeof...(R)</code> may be zero. &mdash; <i>end note</i>] Let <code>C</code> denote the
type, if any, of an unevaluated conditional expression (7.6.16 <a href="https://wg21.link/expr.cond">[expr.cond]</a>) whose first operand is an arbitrary value
of type <code>bool</code>, whose second operand is an xvalue of type <code>T1</code>, and whose third operand is 
an xvalue of type <code>T2</code>.</del> <ins>Let <code>C</code> denote <code>common_type_t&lt;T1, T2&gt;</code>.</ins> 
If there is such a type <code>C</code>, the member typedef <code>type</code> 
shall denote the same type, if any, as <code>common_type_t&lt;C, R...&gt;</code>. Otherwise, there shall 
be no member <code>type</code>.</p></li>
</ol>
</blockquote>
</li>
</ol>
</blockquote>

<p><i>[2016-08-04 Chicago LWG]</i></p>

<p>
Alisdair notes that 16.4.5.2.1 <a href="https://wg21.link/namespace.std">[namespace.std]</a> p.1 seems to prohibit some kinds of specializations that we want to 
permit here and asks that the Table entry be augmented so as to specify the precise rules that a specialization 
is required to obey.
Walter revises Proposed Resolution accordingly.
</p>

<p><i>[2016-08-03 Chicago]</i></p>

<p>Fri PM: Move to Tentatively Ready</p>

<p><i>[2016-08-11 Daniel comments]</i></p>

<p>
LWG <a href="lwg-defects.html#2763" title="common_type_t&lt;void, void&gt; is undefined (Status: Resolved)">2763</a><sup><a href="https://cplusplus.github.io/LWG/issue2763" title="Latest snapshot">(i)</a></sup> presumably provides a superiour resolution that also fixes another bug in the Standard.
</p>

<p><i>[2016-08-12]</i></p>

<p>
Howard request to reopen this issue because of the problem pointed out by LWG <a href="lwg-defects.html#2763" title="common_type_t&lt;void, void&gt; is undefined (Status: Resolved)">2763</a><sup><a href="https://cplusplus.github.io/LWG/issue2763" title="Latest snapshot">(i)</a></sup>.
</p>

<p><i>[2016-08-13 Tim Song comments]</i></p>

<p>
In addition to the issue pointed out in LWG <a href="lwg-defects.html#2763" title="common_type_t&lt;void, void&gt; is undefined (Status: Resolved)">2763</a><sup><a href="https://cplusplus.github.io/LWG/issue2763" title="Latest snapshot">(i)</a></sup>, the current P/R no longer decays the type
of the conditional expression. However, that seems harmless since 7 <a href="https://wg21.link/expr">[expr]</a>/5 means that the 
"type of an expression" is never a reference type, and 7.6.16 <a href="https://wg21.link/expr.cond">[expr.cond]</a>'s rules appear to ensure that
the type of the conditional expression will never be "decay-able" when fed with two xvalues of cv-unqualified
non-array object type. Nonetheless, a note along the lines of "[<i>Note:</i> <code>C</code> is never a reference,
function, array, or cv-qualified type. &mdash; <i>end note</i>]" may be appropriate, similar to the note 
at the end of  [dcl.decomp]/1.
</p>

<p><i>[2016-11-12, Issaquah]</i></p>

<p>Resolved by P0435R1</p>


<p id="res-2465"><b>Proposed resolution:</b></p>
<p>
This wording is relative to N4606.
</p>

<p><i>[This also resolves the first part of LWG <a href="lwg-defects.html#2460" title="LWG issue 2408 and value categories (Status: C++17)">2460</a><sup><a href="https://cplusplus.github.io/LWG/issue2460" title="Latest snapshot">(i)</a></sup>]</i></p>


<ol>
<li><p>In Table 46 &mdash; "Other transformations" edit the entry for <code>common_type</code>:</p>

<blockquote>
<table border="1">
<caption>Table 46 &mdash; Other transformations</caption>
<tr>
<th align="center">Template</th>
<th align="center">Comments</th>
</tr>

<tr>
<td colspan="2" align="center">
<code>&hellip;</code>
</td>
</tr>

<tr>
<td>
<code>template &lt;class... T&gt;<br/>
struct common_type;</code>
</td>

<td>
<ins>Unless this trait is specialized (as specified in Note B, below), t</ins><del>T</del>he<br/>
member typedef <code>type</code> shall be defined or omitted as specified <ins>in Note A,</ins> below.<br/>
If it is omitted, there shall be no member <code>type</code>. All types in the<br/>
parameter pack <code>T</code> shall be complete or (possibly <i>cv</i>) <code>void</code>.<br/> 
<del>A program may specialize this trait<br/> 
if at least one template parameter in the specialization<br/> 
is a user-defined type. [<i>Note:</i> Such specializations are<br/>
needed when only explicit conversions are desired among the template<br/>
arguments. &mdash; <i>end note</i>]</del>
</td>
</tr>

<tr>
<td colspan="2" align="center">
<code>&hellip;</code>
</td>
</tr>

</table>
</blockquote>
</li>

<li><p>Edit 21.3.9.7 <a href="https://wg21.link/meta.trans.other">[meta.trans.other]</a> p3 (and its subbullets) as shown below</p>

<blockquote>
<p>
-3- <ins>Note A:</ins> For the <code>common_type</code> trait applied to a parameter pack <code>T</code> of types, the 
member <code>type</code> shall be either defined or not present as follows:
</p>
<ol style="list-style-type: none">
<li><p>(3.1) &mdash; If <code>sizeof...(T)</code> is zero, there shall be no member <code>type</code>.</p></li>
<li><p>(3.2) &mdash; If <code>sizeof...(T)</code> is one, let <code>T0</code> denote the sole type in the pack <code>T</code>. 
The member typedef <code>type</code> shall denote the same type as <code>decay_t&lt;T0&gt;</code>.</p></li>
<li><p>(3.3) &mdash; <ins>If <code>sizeof...(T)</code> is two, let <code>T1</code> and <code>T2</code>, respectively,
denote the first and second types comprising <code>T</code>, and let <code>D1</code> and <code>D2</code>, 
respectively, denote <code>decay_t&lt;T1&gt;</code> and <code>decay_t&lt;T2&gt;</code>.</ins></p>
<ol style="list-style-type: none">
<li><p>(3.3.1) &mdash; <ins>If <code>is_same_v&lt;T1, D1&gt;</code> and <code>is_same_v&lt;T2, D2&gt;</code>,
let <code>C</code> denote the type of an unevaluated conditional expression (7.6.16 <a href="https://wg21.link/expr.cond">[expr.cond]</a>)
whose first operand is an arbitrary value of type <code>bool</code>,
whose second operand is an xvalue of type <code>D1</code>,
and whose third operand is an xvalue of type <code>D2</code>.
[<i>Note:</i> This will not apply if there is a specialization <code>common_type&lt;D1, D2&gt;</code>. &mdash; 
<i>end note</i>]</ins></p></li>
<li><p>(3.3.2) &mdash; <ins>Otherwise, let <code>C</code> denote the type
<code>common_type_t&lt;D1, D2&gt;</code>.</ins></p></li>
</ol>
<p><ins> In either case, if there is such a type <code>C</code>,
the member typedef <code>type</code> shall denote <code>C</code>.
Otherwise, there shall be no member <code>type</code>.</ins></p>
</li>
<li><p>(3.4) &mdash; If <code>sizeof...(T)</code> is greater than <del>one</del><ins>two</ins>, let <code>T1</code>, <code>T2</code>, and <code>R</code>, 
respectively, denote the first, second, and (pack of) remaining types comprising <code>T</code>. 
<del>[<i>Note:</i> <code>sizeof...(R)</code> may be zero. &mdash; <i>end note</i>] Let <code>C</code> denote the
type, if any, of an unevaluated conditional expression (7.6.16 <a href="https://wg21.link/expr.cond">[expr.cond]</a>) whose first operand is an arbitrary value
of type <code>bool</code>, whose second operand is an xvalue of type <code>T1</code>, and whose third operand is 
an xvalue of type <code>T2</code>.</del> <ins>Let <code>C</code> denote <code>common_type_t&lt;T1, T2&gt;</code>.</ins> 
If there is such a type <code>C</code>, the member typedef <code>type</code> 
shall denote the same type, if any, as <code>common_type_t&lt;C, R...&gt;</code>. Otherwise, there shall 
be no member <code>type</code>.</p></li>
</ol>
<p>
<ins>-?- Note B: A program may specialize the <code>common_type</code> trait for two <i>cv</i>-unqualified 
non-reference types if at least one of them is a user-defined type. [<i>Note:</i> Such specializations are
needed when only explicit conversions are desired among the template
arguments. &mdash; <i>end note</i>] Such a specialization need not have a member named <code>type</code>,
but if it does, that member shall be a <i>typedef-name</i> for a <i>cv</i>-unqualified non-reference type
that need not otherwise meet the specification set forth in Note A, above.</ins>
<p/>
-4- [<i>Example:</i> Given these definitions: [&hellip;]
</p>
</blockquote>
</li>
</ol>





</body>
</html>
