<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta name="generator" content="pandoc" />
  <title>P1787R6: Declarations and where to find them</title>
  <style type="text/css">code{white-space: pre;}</style>
  <style type="text/css">
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
  margin: 0; padding: 0; vertical-align: baseline; border: none; }
table.sourceCode { width: 100%; line-height: 100%; }
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
td.sourceCode { padding-left: 5px; }
code > span.kw { color: #007020; font-weight: bold; }
code > span.dt { color: #902000; }
code > span.dv { color: #40a070; }
code > span.bn { color: #40a070; }
code > span.fl { color: #40a070; }
code > span.ch { color: #4070a0; }
code > span.st { color: #4070a0; }
code > span.co { color: #60a0b0; font-style: italic; }
code > span.ot { color: #007020; }
code > span.al { color: #ff0000; font-weight: bold; }
code > span.fu { color: #06287e; }
code > span.er { color: #ff0000; font-weight: bold; }
  </style>
  <style type="text/css">
  div.del, section.del { background: #fcd; }
  div.ins, section.ins { background: #bfa; }
  .mv { background: #ddf; }
  s, .del { background: #ff8888; margin-right: 0.15ch; }
  u, .ins { background: #88ff88; }
  /* from https://stackoverflow.com/a/32456613 */
  div > blockquote, body > blockquote {
      display: list-item;
      list-style-type: "- ";
  }
  pre {
  		margin-left: 1.2em;
  }
  .tony {
    border-collapse: collapse;
  }
  .tony > tbody > tr {
    vertical-align: top;
  }
  tr.hr, tr.hr {
    border-bottom: thin solid #60a0b0;  /* relies on collapse */
  }
  </style>
</head>
<body>
<div id="header">
<h1 class="title">P1787R6: Declarations and where to find them<!-- -*- c++-md -*- --></h1>
</div>
<p><em>Audience</em>: CWG<br />S. Davis Herring &lt;<script type="text/javascript">
<!--
h='&#108;&#x61;&#110;&#108;&#46;&#x67;&#x6f;&#118;';a='&#64;';n='&#104;&#x65;&#114;&#114;&#x69;&#110;&#x67;';e=n+a+h;
document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+e+'<\/'+'a'+'>');
// -->
</script><noscript>&#104;&#x65;&#114;&#114;&#x69;&#110;&#x67;&#32;&#x61;&#116;&#32;&#108;&#x61;&#110;&#108;&#32;&#100;&#x6f;&#116;&#32;&#x67;&#x6f;&#118;</noscript>&gt;<br />Los Alamos National Laboratory<br />October 23, 2020</p>
<h1 id="history">History</h1>
<p>Since <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1787r5.html">r5</a>:</p>
<ul>
<li>Made implicit header-unit export override internal linkage for “precedes”</li>
<li>Disallowed redeclarations of internal-linkage entities from header units</li>
<li>Specified anonymous union member collisions in terms of correspondence</li>
<li>Applied “reachable” to more cases that assumed a total order</li>
<li>Allowed <code>decltype(f)</code> if <code>f</code> is made unique by constraints</li>
<li>Defined “primary template” generically</li>
<li>Required equivalent template argument lists for all references to partial specializations, resolving CWG2065</li>
<li>Generalized instantiation wording for partial specializations</li>
<li>Fixed nesting of template parameter scopes</li>
<li>Fixed list of declaration types</li>
<li>Fixed default argument availability through a <em>using-declaration</em></li>
<li>Fixed explicit specialization declarations of classes</li>
<li>Fixed correspondence check for redeclarations in <em>template-declaration</em>s</li>
<li>Suppressed lookup for <em>type-parameter</em> declarations</li>
<li>Specified lookup before <code>&lt;</code> even in a <em>declarator-id</em></li>
<li>Required destructor declarations to use the injected-class-name, avoiding name lookup</li>
<li>Simplified lookup for destructors</li>
<li>Specified that <code>&lt;</code> begins a template argument list in a destructor name</li>
<li>Removed transformation of <em>unqualified-id</em>s that refer to static members</li>
<li>Required <em>operator-function-id</em>s be used only for functions</li>
<li>Generalized “first declaration” lookup for modules</li>
<li>Fixed module attachment of friend declarations</li>
<li>Limited lookup around a friend to one scope, leaving CWG1906 closed and replacing the resolution for CWG2370</li>
<li>Clarified definition of “naming class”, resolving CWG952</li>
<li>Generalized <em>using-declaration</em> access control check, resolving CWG360</li>
<li>Consistently described access control in terms of naming members, not their names</li>
<li>Consistently specified overload resolution even for singleton sets</li>
<li>Removed “overloaded function [template]” term</li>
<li>Removed “global function” term</li>
<li>Removed “in scope” term, simplifying the description of local variable lifetime</li>
<li>Removed “scope” for macro parameters</li>
<li>Removed residual “looked up in” usage</li>
<li>Removed redundant normative wording for <code>using B::operator=;</code></li>
<li>Removed redundant prohibition of <code>this</code> in a declarator</li>
<li>Removed redundant wording for anonymous union linkage</li>
<li>Removed blanket statement of namespace scope in the library</li>
<li>Clarified wording for introduction of type names</li>
<li>Clarified that inline class members are always defined</li>
<li>Added excerpts from removed paragraphs</li>
<li>Made wording sections #[searchable]</li>
</ul>
<p>Since <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1787r4.html">r4</a>:</p>
<ul>
<li>Rebased onto N4861 (significant for <em><code>boolean-testable</code></em>)</li>
<li>Allowed <em>using-declaration</em>s to refer to non-dependent conversion function templates</li>
<li>Limited hiding among conversion functions and dependent conversion function templates</li>
<li>Clarified and simplified conversion function template argument deduction</li>
<li>Allowed lookup in reachable class definitions</li>
<li>Excluded internal-linkage namespaces from “precedes” generally</li>
<li>Allowed <em>using-directive</em>s to operate across translation units (though exported only in header units)</li>
<li>Restored most <em>using-directive</em> wording as notes</li>
<li>Gave namespaces a locus</li>
<li>Clarified the status of the global namespace</li>
<li>Clarified the lookup for a namespace to extend</li>
<li>Clarified when declarations refer to the same entity, resolving CWG279, CWG338, CWG1884, CWG1898, CWG1252, CWG2062, and CWG1896</li>
<li>Preserved function-type language linkage in redeclarations</li>
<li>Restored language linkage for class members (with external linkage)</li>
<li>Restored explicit specialization/instantiation declarations for member functions</li>
<li>Restored initialization of an object via conversion to rvalue reference</li>
<li>Specified choice between <code>operator delete</code> and <code>operator delete[]</code> for a <em>delete-expression</em></li>
<li>Addressed non-<em>init-declarator</em> declarators and non-<em>identifier</em> <em>declarator-id</em>s</li>
<li>Defined declaration matching and lookup for <em>nested-name-specifier</em>s in redeclarations and specializations</li>
<li>Removed type-only lookup for <code>…::template A&lt;0&gt;::</code></li>
<li>Removed special name treatment for <code>friend struct S* f();</code></li>
<li>Allowed definitions of nested (local) types at block scope</li>
<li>Introduced “component name” to avoid recursing into template arguments or <em>decltype-specifier</em>s, replacing “appears as a type”</li>
<li>Simplified “name” to be nothing more than one of the relevant grammar non-terminals</li>
<li>Restricted “qualified name” to the name in question</li>
<li>Removed “closed context”, unresolving CWG325</li>
<li>Gave dependent class members priority over unqualified lookup, unresolving CWG1089</li>
<li>Made <code>operator=</code> dependent in any templated class</li>
<li>Separated “dependent call” from “dependent name”</li>
<li>Fixed dependent <em>using-declaration</em>s that refer to templates</li>
<li>Specified that dependent <em>using-declaration</em>s can be dependent members of the current instantiation</li>
<li>Clarified template argument deduction from declarations, resolving CWG271</li>
<li>Forbid use of a function with an undeduced return type without naming it</li>
<li>Specified default argument conflicts via different scopes rather than a common parameter</li>
<li>Reduced extent of several kinds of scopes</li>
<li>Rewrote ADL in terms of searches</li>
<li>Rephrased language linkage in terms of entities (properly including variables)</li>
<li>Accounted for entities declared with C language linkage belonging to multiple scopes</li>
<li>Expressed special <em>declarator-id</em>s as requirements</li>
<li>Merged [temp.inject] into [temp.friend]</li>
<li>Removed disused notion of exporting a name (as opposed to a declaration)</li>
<li>Restored explicit introduction of <em>class-specifier</em> names</li>
<li>Removed redundant class member function wording</li>
<li>Removed definition of inherited non-constructor members</li>
<li>Replaced “local variable” with “block variable”</li>
<li>Replaced some “anonymous union variable”s with “anonymous union member”</li>
<li>Rephrased usage of members of an anonymous union as an <em>id-expression</em> interpretation</li>
<li>Allowed anonymous unions to omit <code>static</code> in any internal-linkage namespace</li>
<li>Removed “-scope” adjectives in normative text</li>
<li>Fixed cross reference to removed subclause</li>
</ul>
<p>Since <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1787r3.html">r3</a>:</p>
<ul>
<li>Rebased onto N4849</li>
<li>Forbid <code>decltype(…)::~…</code></li>
<li>Restored block scope for most compound statements</li>
<li>Fixed scope of parameters of a function declaration</li>
<li>Fixed list of declarations and scope introducers</li>
<li>Removed “direct function lvalue” interpretation for a <em>template-id</em></li>
<li>Made scope-based rules for copy elision and implicit moves consistent</li>
<li>Removed truly final “point of declaration” usage</li>
<li>Clarified terminology (in particular, for enclosing scopes)</li>
<li>Added forward reference note for unusual declaration targets/binding</li>
<li>Removed or labeled deprecated <code>::template</code> in examples</li>
<li>Labeled [class.mfct.non-static] edits correctly</li>
</ul>
<p>Since <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1787r2.html">r2</a>:</p>
<ul>
<li>Rebased onto N4835</li>
<li>Added definition for “reachable from”</li>
<li>Restored Richard’s rule for cross-TU <em>using-declaration</em> conflicts</li>
<li>Generalized consistent-linkage rule for CWG1839</li>
<li>Corrected scope of function-local predefined variables</li>
<li>Updated all references to removed [basic.lookup.classref], resolving CWG255</li>
<li>Removed (remainder of) [class.this]</li>
<li>Removed “global object” term</li>
</ul>
<p>Since <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1787r1.html">r1</a>:</p>
<ul>
<li>Rebased onto N4830 (significant for <code>using</code> enumerators/enumerations)</li>
<li>Added a locus for a <em>concept-definition</em></li>
<li>Extended containing scopes into redeclarations of classes and enumerations</li>
<li>Properly limited cross-TU qualified lookup in namespaces</li>
<li>Fixed rules for conflicts between <em>using-declaration</em>⁠s</li>
<li>Renamed “anonymous union object” to “anonymous union variable”</li>
</ul>
<p>Since <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1787r0.html">r0</a>:</p>
<ul>
<li>Fixed reversed <em>using-directive</em> containment test</li>
<li>Updated <strong>signature</strong> definitions</li>
<li>Removed residual “point of declaration” usage</li>
<li>Fixed several uses of (new) “precede” to be (existing) “reachable”</li>
<li>Removed dangling “considered to refer to a template” reference</li>
<li>Used “be attached” for modules instead of (new, unrelated) “belong”</li>
<li>Included class templates with classes for all scope purposes</li>
<li>Distinguished entities from their associated scopes</li>
<li>Accounted for missing kinds of declarations</li>
<li>Removed superfluous definition of “denotes”</li>
<li>Disentangled “enclose” and “contain” definitions</li>
<li>Specified no lookup for <code>X</code> in <code>using X=...;</code></li>
<li>Allowed a <em>namespace-name</em> to be a member-qualified name</li>
<li>Allowed in-class lookup of <code>X</code> in <code>p-&gt;~X()</code> and <code>decltype(...)::~X()</code></li>
<li>Ignored non-type <code>X</code> in <code>struct N::X x;</code></li>
<li>Limited <code>this</code>/<code>static</code> prohibition with “current class”</li>
<li>Deprecated <code>A::template B</code> (as a template template argument or CTAD placeholder)</li>
<li>Allowed forward declarations of partial specializations</li>
<li>Removed mention of resolved issue</li>
<li>Added explanatory examples to aid review</li>
</ul>
<h1 id="introduction">Introduction</h1>
<p>The current descriptions of scope and name lookup are confusing, incomplete, and at times incorrect. [basic.scope] defines the word “scope” in two different ways, and then implicitly and indirectly specifies many aspects of name lookup with imperfect correspondence to the descriptions in [basic.lookup]. Lookup is often described for units of program text that may include multiple names and <code>&lt;</code> tokens that must be disambiguated, such as a <em>template-id</em> ([temp.dep]/2), <em>id-expression</em> ([over.call.func]/2), or <em>conversion-type-id</em> ([class.qual]/1.2). Namespaces, and the global namespace in particular, are inconsistently described as being one or many declarative regions ([basic.scope.namespace]/1, /4). There are dozens of Core issues on the subject; the general vagueness of the wording on the subject interferes with resolving them individually.</p>
<p>Modules significantly complicate the situation, principally by invalidating the tacit assumption that “every” lookup is restricted to preceding declarations in the same translation unit. There were already exceptions to that rule (<em>e.g.</em>, complete class contexts and <a href="http://wiki.edg.com/pub/Wg21belfast2019/CoreWorkingGroup/cwgMMMM.html"><em>using-declaration</em> conflicts</a>), which can then easily be (mis)read as applying to all contents of all translation units. Many rules, like those for lookup through a <em>using-directive</em>, do not make any mention of location at all, and so become ambiguous.</p>
<p>The similar process of associating a declaration with a previous declaration of the same name is also poorly specified. In particular, there is no consistent rule as to whether multiple declarations of the same name introduce distinct entities (that might conflict) or one entity (and might conflict).</p>
<p>This paper rewrites large sections of [basic.scope] and [basic.lookup] and parts of [temp.res] (and makes the requisite changes elsewhere to adapt to new definitions) to address these issues holistically. As discussed individually <a href="#issues">below</a>, 63 Core issues are resolved, as well as 21 points discussed on the reflector but not (yet) on the issues list. Many changes are (collectively) editorial, but their very number demands CWG review. Other changes generally formalize current implementation practice or, in the absence of implementation consensus, establish language consistency.</p>
<h1 id="approach">Approach</h1>
<p>To avoid redundant specification of scope and of name lookup, all description of where a name might be used ([basic.scope.block], [basic.scope.enum], <em>etc.</em>) is phrased merely in terms of the total extent of each scope where a name might be introduced. Except for template parameter scopes, scopes are hierarchical, although unqualified lookups in certain friend declarators consider a scope that does not contain the point of the lookup. Explicit wording is introduced to require that lookup occur from a program point (replacing lookup “in the context” of something) and consider only previous declarations (except in complete-class contexts) and those made available by <code>import</code>. Most declarations are said to “bind” the names they introduce to themselves, replacing the notion of “not found by lookup”. To avoid confusion, the word “bind” is not used for describing locked-in lookup results as for default arguments (which can instead be described as being looked up from their declarations). The use of the word “visible” to indicate a declaration’s placement is avoided in normative text.</p>
<p>Several kinds of scope search are defined, and several kinds of qualified lookup are combined, to minimize redundancy in the definition of the lookup algorithms. The word “lookup” or phrase “look up” is used only for resolution of a name that is complete (at least in the simple context; it might be reused as a subroutine elsewhere). Lookup is defined for <em>nested-name-specifier</em>s in <em>declarator-id</em>s.</p>
<p>The descriptions of the algorithms generally favor local completeness at the expense of additional references to distant clauses (that would otherwise specify special cases for their respective language features). <!-- Exceptions are indicated by "remote" in a comment. --> Several rule restatements are turned into notes.</p>
<p>Every lookup is explicitly for a name, not an <em>id-expression</em> or <em>type-id</em>. Template arguments in an <em>id-expression</em> are addressed by defining which names are subject to qualified lookup and by excluding a <em>template-id</em> from being a name. Because labels interact with so little of the language, their identifiers are excluded from names and name lookup entirely.</p>
<p>To avoid confusion when a name is declared multiple times in a scope, careful distinction is made between a name and a declaration of that name. In particular, the “point of declaration” of a name (usually; [basic.scope.pdecl]/3 describes one for an unnamed class or enumeration) is replaced with the “locus” of a declaration.</p>
<p>The phrases “global name” and “global object” are removed to reduce the apparent special status of the global namespace (but “global scope” still exists because of its lack of syntax and as a shorthand).</p>
<p>Wording for the (possible) declaration of a class by an <em>elaborated-type-specifier</em> is removed from [basic.scope.pdecl]/7, [basic.lookup.elab]/2, [namespace.memdef]/3, and [class.friend]/11 and merged into [dcl.type.elab].</p>
<p>Richard’s proposal for <a href="http://lists.isocpp.org/core/2019/03/5795.php">“using-declarations &amp; {,!}export”</a> is followed: a (non-dependent) <em>using-declaration</em> is replaced with its referent(s) during name lookup rather than introducing additional declarations. Because it is consistent with that replacement, and for consistency with existing implementations, the inclusion of hidden type names by a member <em>using-declaration</em> is extended to those not in a class.</p>
<p>Declarations are deemed to declare the same entity when they must do so, categorizing conflicts between, say, <code>namespace x {}</code> and <code>template&lt;class&gt; concept x=true;</code> as inconsistent redeclarations. The word “redeclaration” is restricted to that case (and not a declaration of an existing name in a new scope). A procedure is specified for connecting a declaration of a qualified name or a template specialization to the original declaration of the name or template, aggregating wording scattered across [namespace.qual]/7, [basic.link]/6–7, [namespace.memdef]/2–3, [class.mfct]/1–3, [class.static.data]/3, [temp.class]/3, and [temp.class.spec.mfunc]/1. (This is not considered name lookup, partly because a mechanism other than overload resolution is used to resolve ambiguities.) Language linkage is respecified as being an attribute of an entity (or a function type), not a name.</p>
<h2 id="examples">Examples</h2>
<p>The lookup for the following examples is narrated to help CWG members relate old and new terminology. Cross references prefixed with + are to N4861 as edited here.</p>
<h3 id="using-directive-vs.-using-declaration"><em>using-directive</em> vs. <em>using-declaration</em></h3>
<pre class="sourceCode cpp"><code class="sourceCode cpp"><span class="kw">namespace</span> F {<span class="dt">float</span> x;}
<span class="kw">namespace</span> A {
  <span class="kw">namespace</span> I {<span class="dt">int</span> x;}
  <span class="kw">using</span> <span class="kw">namespace</span> I;
  <span class="kw">using</span> F::x;
  <span class="dt">void</span> f() {
    x=<span class="dv">0</span>;     <span class="co">// #1: error</span>
    A::x=<span class="dv">1</span>;  <span class="co">// #2: OK: F::x</span>
  }
}</code></pre>
<ol style="list-style-type: decimal">
<li>At #1, <code>x</code> is looked up as an unqualified name (+[basic.lookup.unqual]/4) via an unqualified search of the function block scope of <code>A::f</code> (/3).</li>
<li>When continuing on past the function parameter scope of <code>A::f</code> to the namespace scope of <code>A</code>, the unqualified search searches <code>A</code> and also every namespace contained by <code>A</code> and nominated by an active <em>using-directive</em> (/2).</li>
<li>The single <em>using-directive</em> is active in the block scope (/1), which is contained by <code>A</code>, as is <code>I</code>.</li>
<li>Therefore <code>A</code> and <code>I</code> are searched simultaneously.</li>
<li>The <em>using-declaration</em> is replaced with <code>F::x</code> (+[basic.lookup]/4), and the lookup is ambiguous ([basic.lookup]/1).</li>
</ol>
<!-- two lists -->

<ol style="list-style-type: decimal">
<li>At #2, <code>A</code> is looked up as an unqualified name. <code>x</code> is a qualified name (+[basic.lookup.qual]/2), so undergoes qualified name lookup (/3) which is just a search of <code>A</code>.</li>
<li>The search finds <code>F::x</code>, so the <em>using-directive</em> is not considered by +[namespace.qual]/1.</li>
</ol>
<h3 id="cwg459"><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#459">CWG459</a></h3>
<pre class="sourceCode cpp"><code class="sourceCode cpp"><span class="kw">struct</span> A {<span class="kw">using</span> T=<span class="dt">int</span>;};  <span class="co">// given</span>
<span class="kw">template</span>&lt;<span class="kw">class</span> T&gt;
<span class="kw">struct</span> B : A {
  <span class="dt">void</span> f() {T i;}
};</code></pre>
<ol style="list-style-type: decimal">
<li><code>T</code> (in the <em>template-head</em>), <code>B</code>, and <code>f</code> are not looked up (+[dcl.meaning]/3, +[class.pre]/1) because they introduce entities. (They may be used to recognize existing declarations being redeclared or with which there is a conflict, but they are not “evaluated” to an entity.)</li>
<li><code>A</code> is looked up as an unqualified name (+[basic.lookup.unqual]/4), ignoring non-type names ([class.derived]/2).</li>
<li><code>T</code> is looked up as an unqualified name when defining the class template <code>B</code> (+[temp.res]/1):
<ol style="list-style-type: decimal">
<li>Unqualified name lookup performs an unqualified search in the enclosing scope (+[basic.lookup.unqual]/3), which is the function block scope of <code>B::f</code> (+[basic.scope.block]/1).</li>
<li>For each enclosing scope, an unqualified search is just a search except when considering a namespace (+[basic.lookup.unqual]/2); a search is just a single search except when considering a class (template) (+[class.member.lookup]/1). The function block scope is neither and has no binding for <code>T</code> (and the parameter scope (+[basic.scope.param]/1) has only <code>__func__</code>).</li>
<li>The next enclosing scope is that of <code>B</code>; classes and class templates have scopes (+[basic.scope.class]/1). It is a class template, and a single search in it finds nothing ([class.member.lookup]/4), so its non-dependent base classes are considered (+[class.member.lookup]/5).</li>
<li>A single search in the scope of <code>A</code> finds the <em>typedef-name</em>.</li>
<li>The next enclosing scope is the template parameter scope to which the template parameter <code>T</code> belongs ([basic.scope.temp]/2), but it is never considered.</li>
</ol></li>
</ol>
<h3 id="calling-a-conversion-function">Calling a conversion function</h3>
<pre class="sourceCode cpp"><code class="sourceCode cpp"><span class="dt">auto</span> x = s.<span class="kw">operator</span> R T::*();</code></pre>
<ol style="list-style-type: decimal">
<li><code>x</code> is not looked up (+[dcl.meaning]/3).</li>
<li><code>s</code> is subject to normal unqualified lookup (+[basic.lookup.unqual]/4).</li>
<li>The names used in the <em>conversion-type-id</em> are looked up “in the same fashion as the <em>conversion-function-id</em>” (/5).</li>
<li>While that lookup can’t happen yet, the <em>conversion-function-id</em> is a member-qualified name (+[basic.lookup.qual]/2) and thus undergoes qualified lookup in the class of <code>s</code> (call it <code>S</code>; /3).</li>
<li>If <code>S::R</code> finds nothing, <code>R</code> is looked up as an unqualified name (+[basic.lookup.unqual]/5 again); <code>T</code> is considered the same way (separately), except that non-type names are ignored because of the following <code>::</code> ([basic.lookup.qual]/1).</li>
<li>Once the type named by the <em>conversion-type-id</em> is known ([class.conv.fct]/1), the <em>conversion-function-id</em> is looked up as described above (including conversion function templates via +[class.member.lookup]/8).</li>
</ol>
<h3 id="calling-destructors">Calling destructors</h3>
<pre class="sourceCode cpp"><code class="sourceCode cpp"><span class="kw">struct</span> A {<span class="kw">using</span> X=A;};
<span class="kw">struct</span> B : A {<span class="kw">struct</span> X {};};
<span class="dt">void</span> f(B *b) {
  b-&gt;A::~X();            <span class="co">// error: A::X not considered</span>
}</code></pre>
<ol style="list-style-type: decimal">
<li>In <code>f</code>, <code>A</code> undergoes qualified lookup in <code>B</code> (+[basic.lookup.qual]/3).</li>
<li>Because the terminal name (+[expr.prim.id.unqual]/2) of its <em>nested-name-specifier</em> is a (member-)qualified name (+[basic.lookup.qual]/2), <code>X</code> is looked up if in <code>b-&gt;~X</code> (/4.3).</li>
<li>That lookup finds <code>B::X</code> by qualified lookup and nothing by unqualified lookup (/4.1), but not the required lookup context <code>A</code> (/4.6).</li>
</ol>
<h1 id="issues">Issues</h1>
<h2 id="definitions">Definitions</h2>
<p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#554">CWG554</a> is resolved by using the word “scope” <em>instead of</em> “declarative region”, consistent with its very common use in phrases like “namespace scope”. The other uses of “scope” are implied by the explicit unqualified lookup algorithm. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#2165">CWG2165</a> is resolved by removing the conflicting definition of it in [basic.scope].</p>
<p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#405">CWG405</a> is resolved by stating that argument-dependent lookup (sometimes) occurs after an ordinary unqualified lookup (making statements like “finding a variable prevents argument-dependent lookup” formally correct).</p>
<p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#36">CWG36</a> (which has the dubious distinction of having the earliest recorded date) is resolved by limiting the restriction in question to class scopes, where ambiguous accessibility would be a problem, since a <em>using-declaration</em> does not introduce declarations. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#418">CWG418</a> is resolved by trivial rephrasing along with that necessary for the new <em>using-declaration</em> interpretation. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#1960">CWG1960</a> (currently closed as NAD) is resolved by removing the rule in question (which is widely ignored by implementations and gives subtle interactions between <em>using-declaration</em>s).</p>
<p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1291">CWG1291</a> and <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#2396">CWG2396</a> are resolved by explicitly specifying how to look up names in a <em>conversion-type-id</em>.</p>
<p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#600">CWG600</a> is resolved by explaining that accessibility affects naming a member in the sense of the ODR. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#360">CWG360</a> is resolved by applying access control to <em>using-declaration</em>s. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#952">CWG952</a> is resolved by refining the definition of “naming class” per Richard’s suggestion in <a href="https://lists.isocpp.org/core/2020/09/9963.php">“CWG1621 and [class.static]/2”</a>.</p>
<p>My proposed regularization of <em>try-block</em> containment in <a href="https://lists.isocpp.org/core/2020/02/8569.php">“Cases missed by P1825R0 (Merged wording for P0527R1 (Implicitly move from rvalue references in return statements) and P1155R3 (More implicit moves))”</a> is included in rewording the relevant bullets.</p>
<h2 id="lookup-completeness">Lookup completeness</h2>
<p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#191">CWG191</a> and <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1200">CWG1200</a> are resolved by defining unqualified lookup in terms of every enclosing scope. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#536">CWG536</a> (long partially resolved) is resolved by specifying that unqualified lookup occurs for any kind of <em>unqualified-id</em> as an <em>id-expression</em>. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#399">CWG399</a> is resolved by explicitly appealing to the lookup for the last component of any suitable <em>nested-name-specifier</em>. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#562">CWG562</a> is resolved by defining lookup as occurring from a program point.</p>
<p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#2370">CWG2370</a> is resolved by performing a search in (only) the immediate scope of any friend, per the <a href="http://wiki.edg.com/bin/view/Wg21sandiego2018/CoreWorkingGroup#Core_issue_2370_friend_declarati">CWG opinion from San Diego</a>.</p>
<p>My proposed simplification for <a href="http://lists.isocpp.org/core/2019/03/5681.php">“Missing associated namespace for member template template arguments?”</a> is incorporated on the assumption that the failure to examine the namespace of an associated class is an oversight. (GCC and ICC, but not Clang or MSVC, accept the example in that message.)</p>
<p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1822">CWG1822</a> is resolved by specifying that the body of a lambda remains in the surrounding (function parameter) scope.</p>
<p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1894">CWG1894</a> and its duplicate <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#2199">CWG2199</a> are resolved per Richard’s proposal for <a href="https://listarchives.isocpp.org/cgi-bin/wg21/message?wg=core&amp;msg=28415">“dr407 still leaves open questions about typedef / tag hiding”</a>, using generic conflicting-declaration rules even for <code>typedef</code>, and discarding a redundant <em>typedef-name</em> when looking up an <em>elaborated-type-specifier</em>.</p>
<p>The suggestion in [namespace.udir]/5 that declarations become available only after a <em>namespace-definition</em> is removed.</p>
<p>Jens’ interpretation of <a href="http://lists.isocpp.org/core/2019/04/6024.php">“On beyond CWG372”</a> is included as a note (<em>cf.</em> Richard’s <a href="http://lists.isocpp.org/core/2019/04/6026.php">proposed restriction</a>)<!-- FIXME: which would obviate the need for the *base-specifier* note -->. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#607">CWG607</a> is resolved by looking up unqualified names in a <em>mem-initializer-id</em> from outside the parameter scope. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1837">CWG1837</a> is resolved by restricting <code>this</code> to referring to the innermost enclosing class.</p>
<p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#2007">CWG2007</a> is resolved by skipping unqualified lookup for operators that must be member functions. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#255">CWG255</a> (partially resolved by <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3778.html">N3778</a> is resolved by generally specifying the restriction to usual deallocation functions.</p>
<p>Richard’s correction to template parameter scope for constrained template template parameters for <a href="http://lists.isocpp.org/core/2019/05/6122.php">“CWG186 is NAD (or ‘Resolved’)”</a> is incorporated. His correction to function parameter scope for non-defining declarations in <a href="https://lists.isocpp.org/core/2020/01/8363.php">“Using a function parameter in a requires clause”</a> is applied directly.</p>
<p>The missing point of declaration for a concept identified by Andrew in <a href="https://lists.isocpp.org/core/2019/09/7238.php">“recursive concepts”</a> is supplied (without any prohibition on self-referential concepts).</p>
<h2 id="complete-class-context">Complete-class context</h2>
<p>The intent for <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#2335">CWG2335</a> (contra those of the older <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1890">CWG1890</a>, <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1626">CWG1626</a>, <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1255">CWG1255</a>, and <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#287">CWG287</a>) is supported by retaining the unrestricted forward lookup in complete-class contexts (despite current implementation behavior for non-templates). <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#361">CWG361</a> is partially resolved by that confirmation; the rest must be addressed along with CWG2335. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#2331">CWG2331</a> is resolved by defining lookup from complete-class contexts and out-of-line member definitions. The rest of <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#2009">CWG2009</a> is resolved by making it ill-formed NDR for forward lookup outside a complete-class context to change the results (before overload resolution, to avoid differences in instantiation). A workaround for the practical issue of <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#325">CWG325</a> is introduced by generalizing the <code>template</code> prefix to support lookup in an incomplete class. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1635">CWG1635</a> is partially resolved by also making template default arguments a complete-class context.</p>
<h2 id="declaration-matching">Declaration matching</h2>
<p>My clarification in <a href="http://lists.isocpp.org/core/2019/06/6614.php">“Where can namespace-scope functions and variables be redeclared?”</a> is applied, resolving <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1821">CWG1821</a>. My generalization for member redeclarations in <a href="https://lists.isocpp.org/core/2020/10/10000.php">“CWG498 and class member redeclarations”</a> is applied.</p>
<p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1820">CWG1820</a> is resolved by requiring that a qualified <em>declarator-id</em> declare an entity. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#386">CWG386</a>, <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1839">CWG1839</a>, <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1818">CWG1818</a>, <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#2058">CWG2058</a>, <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1900">CWG1900</a>, and Richard’s observation in <a href="http://lists.isocpp.org/core/2017/01/1604.php">“are non-type names ignored in a class-head-name or enum-head-name?”</a> are resolved by describing the limited lookup that occurs for a <em>declarator-id</em>, including the changes in Richard’s <a href="http://wiki.edg.com/pub/Wg21cologne2019/CoreWorkingGroup/cwg1839.html">proposed resolution for CWG1839</a> (which also resolves CWG1818 and what of CWG2058 was not resolved along with CWG2059) and rejecting the example from <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1477">CWG1477</a>. Consistent linkage is preserved by strengthening [dcl.stc]/6. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#138">CWG138</a> is resolved according to <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2000/n1229.html">N1229</a>, except that <em>using-directive</em>s that nominate nested namespaces are considered.</p>
<p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#563">CWG563</a> is resolved by simplifications that follow its suggestions.</p>
<p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#110">CWG110</a> is resolved by reducing the restriction in [temp.pre] to a note (matching the behavior of GCC, Clang, and ICC). <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1898">CWG1898</a> is resolved by explicitly using the defined term parameter-type-list. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1884">CWG1884</a>, <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#279">CWG279</a>, and <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#338">CWG338</a> are resolved by defining entity identity explicitly. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1252">CWG1252</a> is resolved by defining it for member and non-member functions as consistently as is appropriate. The incomplete consideration of constraints identified by Barry in <a href="https://lists.isocpp.org/core/2020/05/9114.php">“Using-declaration with constrained members ([namespace.udecl]/14)”</a> is addressed by reusing the general function identity definition. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#2062">CWG2062</a>, <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1896">CWG1896</a>, and <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1729">CWG1729</a> (which, as indicated, was already partially resolved) are resolved by specifying consistency requirements for all entities.</p>
<h2 id="modules">Modules</h2>
<p>Richard’s proposed resolution for <a href="http://lists.isocpp.org/core/2019/04/6014.php">“missing restriction on private-module-fragment”</a> is incorporated. His suggestion for <a href="http://lists.isocpp.org/core/2019/05/6207.php">“modules &amp; friends”</a> is also applied.</p>
<p>Nathan’s question about <code>export using</code> in <a href="http://lists.isocpp.org/core/2019/03/5773.php">“using-declarations &amp; {,!}export”</a> is avoided by not introducing synonyms that might or might not be exported. Richard’s <a href="http://wiki.edg.com/pub/Wg21belfast/CoreWorkingGroup/cwgMMMM.html">issue submission for <em>using-declaration</em> conflicts</a> is resolved by combining the generic notions of “conflicts with” and “precedes”. A declaration being exported is made to override its having internal linkage to give effect to the universal export in header units.</p>
<h2 id="parsing">Parsing</h2>
<p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1828">CWG1828</a> is resolved by disfavoring the interpretation of <code>::</code> as an entire <em>nested-name-specifier</em>. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1771">CWG1771</a> is resolved by describing the lookup of only an <em>identifier</em> preceding a <code>::</code> (as in the suggested resolution for CWG1828).</p>
<p>My proposal for <a href="https://lists.isocpp.org/core/2019/05/6171.php">“‘Down with template!’”</a> is incorporated by generalizing “type-id-only context” to “type-only context” and applying it to <code>template</code> as well as <code>typename</code>. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1835">CWG1835</a> is resolved by removing the special provision for <code>-&gt;</code>/<code>.</code> <em>identifier</em> <code>&lt;</code> in [basic.lookup.classref]/1, requiring that <code>template</code> be used to refer even to a non-member template in that position. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1908">CWG1908</a> is resolved per its suggestion of performing qualified lookup first and stopping if it produces a <em>template-id</em>, always taking <code>&lt;</code> to indicate one (per Richard’s proposal for <a href="http://lists.isocpp.org/core/2019/04/6042.php">“On beyond CWG1908”</a>). My further <a href="http://lists.isocpp.org/core/2019/04/6074.php">proposal</a> for parsing a <em>qualified-id</em> in a dependent class member access is applied. My proposal for <a href="http://lists.isocpp.org/core/2019/05/6257.php">“grammar ambiguities with non-simple template-ids”</a> is applied, allowing any kind of name to be considered to refer to a template, except for a <em>conversion-function-id</em> for which the rules would be more complicated despite never applying. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1841">CWG1841</a> is resolved by considering the injected-class-name of a class template to refer to a template.</p>
<p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1616">CWG1616</a> is resolved by explicitly characterizing the forbidden case in terms of lookup results.</p>
<h2 id="templates">Templates</h2>
<p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#459">CWG459</a> is not affected: base classes are still searched in unqualified lookup before template parameters are considered.</p>
<p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1936">CWG1936</a> is resolved by expanding the definition of “dependent name” to include qualified names (<em>i.e.</em>, names previously said to be “a member of an unknown specialization”). <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1500">CWG1500</a> is resolved by further expanding it to include any <em>conversion-function-id</em> with a dependent type (and clarifying that dependent lookup takes place after substitution). My proposed regularization of <em>conversion-type-id</em> interpretation (which includes resolving <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#2413">CWG2413</a>) in <a href="http://lists.isocpp.org/core/2019/05/6178.php">“‘Down with template!’”</a> and proposed rule for considering conversion function templates in <a href="http://lists.isocpp.org/core/2019/05/6339.php">“When are conversion function templates hidden?”</a> are incorporated. The assumption that a dependent qualified name names a type is disabled inside a <code>decltype</code> or array bound. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1028">CWG1028</a> is resolved by moving the “lookup from first declaration” rule from [temp.over.link]/5 to [temp.res]/1 (and generalizing it for modules). <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1907">CWG1907</a> is resolved by forbidding dependence on default (template) arguments not found by <em>lookup</em> for a dependent name.</p>
<p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#2065">CWG2065</a> is resolved by consistently appealing to equivalence (which automatically accounts for mere functional equivalence) and specifying the interpretation of declarative <em>nested-name-specifier</em>s. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1829">CWG1829</a> is resolved by checking for direct members of a class that is the current instantiation. Nathan’s proposal of making the name <code>operator=</code> dependent in <a href="https://lists.isocpp.org/core/2018/11/5305.php">“When are class template assignment operators declared?”</a> is incorporated.</p>
<p>Prioritizing member lookup over unqualified lookup affirms that the templates in <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1089">CWG1089</a> are not functionally equivalent, leaving the matter as a missing condition for them to not be equivalent. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1478">CWG1478</a> is resolved per <a href="http://lists.isocpp.org/core/2019/05/6192.php">my interpretation</a> as independently suggested by Richard in <a href="http://lists.isocpp.org/core/2019/05/6247.php">“Implementation status of core issue 96”</a>.</p>
<p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#2070">CWG2070</a> is resolved by specifying that a dependent <em>using-declarator</em> is considered to name a constructor if and only if it ends with <code>B::B</code>. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#852">CWG852</a> is resolved by explicitly mentioning <em>using-declaration</em>⁠s in class templates (and making it diagnosable in most cases to refer to a class that is definitely not a base).</p>
<p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#2213">CWG2213</a> is resolved by allowing an <em>elaborated-type-specifier</em> to contain a <em>simple-template-id</em> without <code>friend</code>.</p>
<p>Richard’s simplification in <a href="https://lists.isocpp.org/core/2020/02/8446.php">“Deduction failures and template-ids”</a> is applied as part of regularizing the interpretation of function names.</p>
<p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#271">CWG271</a>, long partially resolved by the addition of [temp.deduct.decl], is resolved by replacing the explicit mentions of function parameters with cross references to it.</p>
<h1 id="wording">Wording</h1>
<p>Relative to N4861.</p>
<h2 id="intro.defs">#[intro.defs]</h2>
<h3 id="defns.signature">#[defns.signature]</h3>
<p>Change the definition (leaving the note):</p>
<blockquote>
<p><strong>signature</strong><br />〈function〉 name, parameter-type-list ([dcl.fct]), and enclosing namespace<s> (if any)</s></p>
</blockquote>
<h3 id="defns.signature.templ">#[defns.signature.templ]</h3>
<p>Change:</p>
<blockquote>
<p><strong>signature</strong><br />〈function template〉 name, parameter-type-list ([dcl.fct]), enclosing namespace<s> (if any)</s>, return type, <em>template-head</em>, and trailing <em>requires-clause</em> ([dcl.decl]) (if any)</p>
</blockquote>
<h2 id="intro.compliance">#[intro.compliance]</h2>
<p>Change paragraph 5:</p>
<blockquote>
<p><s>The names defined in the library have namespace scope ([basic.namespace]).</s> A C++ translation unit ([lex.phases]) obtains access to the<s>se</s> names<u> defined in the library</u> by including the appropriate standard library header or importing the appropriate standard library named header unit ([using.headers]).</p>
</blockquote>
<h2 id="lex.ext">#[lex.ext]</h2>
<p>Change paragraph 2:</p>
<blockquote>
<p>A <em>user-defined-literal</em> is treated as a call to a literal operator or literal operator template ([over.literal]). To determine the form of this call for a given <em>user-defined-literal</em> <em>L</em> with <em>ud-suffix</em> <em>X</em>, <u>first let <em>S</em> be the set of declarations found by unqualified lookup for </u>the <em>literal-operator-id</em> whose literal suffix identifier is <em>X</em><s> is looked up in the context of <em>L</em> using the rules for unqualified name lookup</s> ([basic.lookup.unqual]). <s>Let <em>S</em> be the set of declarations found by this lookup.</s> <em>S</em> shall not be empty.</p>
</blockquote>
<h2 id="basic">#[basic]</h2>
<h3 id="basic.pre">#[basic.pre]</h3>
<p>Change paragraph 4:</p>
<blockquote>
<p>A <em>name</em> is <s>a use of </s>an <em>identifier</em> ([lex.name]), <em>operator-function-id</em> ([over.oper]), <em>literal-operator-id</em> ([over.literal]), <u>or </u><em>conversion-function-id</em> ([class.conv.fct])<s>, or <em>template-id</em> ([temp.names]) that denotes an entity or label ([stmt.goto], [stmt.label])</s>.</p>
</blockquote>
<p>Change paragraph 5:</p>
<blockquote>
<p>Every name<s> that denotes an entity</s> is introduced by a <em>declaration</em><s>. Every name that denotes a label is introduced either by a <code>goto</code> statement ([stmt.goto]) or a <em>labeled-statement</em> ([stmt.label])</s><u>, which is a</u></p>
<ol style="list-style-type: decimal">
<li><u><em>declaration</em>, <em>block-declaration</em>, or <em>member-declaration</em> ([dcl.pre], [class.mem])</u></li>
<li><u><em>init-declarator</em> ([dcl.decl]),</u></li>
<li><u><em>identifier</em> in a structured binding declaration ([dcl.struct.bind]),</u></li>
<li><u><em>init-capture</em> ([expr.prim.lambda.capture])</u></li>
<li><u><em>condition</em> with a <em>declarator</em> ([stmt.stmt]),</u></li>
<li><u><em>member-declarator</em> ([class.mem]),</u></li>
<li><u><em>using-declarator</em> ([namespace.udecl]),</u></li>
<li><u><em>parameter-declaration</em> ([dcl.fct]),</u></li>
<li><u><em>type-parameter</em> ([temp.param]),</u></li>
<li><u><em>elaborated-type-specifier</em> that introduces a name ([dcl.type.elab]),</u></li>
<li><u><em>class-specifier</em> ([class.pre]),</u></li>
<li><u><em>enum-specifier</em> or <em>enumerator-definition</em> ([dcl.enum]),</u></li>
<li><u><em>exception-declaration</em> ([except.pre])</u></li>
<li><u>implicit declaration of an injected-class-name ([class.pre])</u>.</li>
</ol>
<p><u>[<em>Note</em>: The interpretation of a <em>for-range-declaration</em> produces one or more of the above ([stmt.ranged]). — <em>end note</em>] An entity <em>E</em> is <em>denoted</em> by the name (if any) that is introduced by a declaration of <em>E</em> or by a <em>typedef-name</em> introduced by a declaration specifying <em>E</em>.</u></p>
</blockquote>
<p>Change paragraph 9:</p>
<blockquote>
<p>Two names are <em>the same</em> if</p>
<ol style="list-style-type: decimal">
<li>they are <em>identifier</em>⁠s composed of the same character sequence, or</li>
<li>they are <em>operator-function-id</em>⁠s formed with the same operator, or</li>
<li>they are <em>conversion-function-id</em>⁠s formed with <s>the same</s><u>equivalent ([temp.over.link])</u> type<u>s</u>, or</li>
<li><s>they are <em>template-id</em>⁠s that refer to the same class, function, or variable ([temp.type]), or</s></li>
<li>they are <em>literal-operator-id</em>⁠s ([over.literal]) formed with the same literal suffix identifier.</li>
</ol>
</blockquote>
<h3 id="basic.def">#[basic.def]</h3>
<p>Change paragraph 1:</p>
<blockquote>
<p>A declaration ([dcl.dcl]) may <u>(re)</u>introduce one or more names<u> and/or entities</u> into a translation unit<s> or redeclare names introduced by previous declarations</s>. If so, the declaration specifies the interpretation and semantic properties of these names. <u>A declaration of an entity or <em>typedef-name</em> <em>X</em> is a <em>redeclaration</em> of <em>X</em> if another declaration of <em>X</em> is reachable from it ([module.reach]).</u> […]</p>
</blockquote>
<p>Change bullet (2.5):</p>
<blockquote>
<p>it is<s> introduced by</s> an <em>elaborated-type-specifier</em> ([class.name]),</p>
</blockquote>
<h3 id="basic.def.odr">#[basic.def.odr]</h3>
<p>Change paragraph 4:</p>
<blockquote>
<p><u>A variable is named by an expression if the expression is an <em>id-expression</em> that denotes it.</u> A variable <code>x</code> <s>whose </s>name<u>d</u> <s>appears as</s><u>by</u> a potentially-evaluated expression <em>E</em> […]</p>
</blockquote>
<h3 id="basic.scope">#[basic.scope]</h3>
<div class="del">
<h4>#[basic.scope.declarative]</h4>
</div>
<p>Remove subclause, referring the old stable name to [basic.scope.scope] (added below). Remove the cross reference in [dcl.struct.bind]/1. Update the 2 surviving cross references (in [basic.def.odr]/9) to refer to [basic.scope.scope]. Replace the 8 surviving mentions of “declarative region” (in [basic.def.odr]/9, [expr.prim.id.unqual]/2, and [expr.prim.lambda.capture]/7) with “scope”.</p>
<div class="ins">
<h4>General #[basic.scope.scope]</h4>
<p>Add subclause to front of [basic.scope], adapting a note and examples from [over.load] and [namespace.alias]/3:</p>
<blockquote>
<p>The declarations in a program appear in a number of <em>scopes</em> that are in general discontiguous. The <em>global scope</em> contains the entire program; every other scope <em>S</em> is introduced by a declaration, <em>parameter-declaration-clause</em>, statement, or <em>handler</em> (as described in the following subclauses of [basic.scope]) appearing in another scope which thereby contains <em>S</em>. An <em>enclosing</em> scope at a program point is any scope that contains it; the smallest such scope is said to be the <em>immediate scope</em> at that point. A scope <em>intervenes</em> between a program point <em>P</em> and a scope <em>S</em> (that does not contain <em>P</em>) if it is or contains <em>S</em> but does not contain <em>P</em>.</p>
</blockquote>
<blockquote>
<p>Unless otherwise specified:</p>
<ol style="list-style-type: decimal">
<li>The smallest scope that contains a scope <em>S</em> is the <em>parent scope</em> of <em>S</em>.</li>
<li>No two declarations (re)introduce the same entity.</li>
<li>A declaration <em>inhabits</em> the immediate scope at its locus ([basic.scope.pdecl]).</li>
<li>A declaration’s <em>target</em> scope is the scope it inhabits.</li>
<li>Any names (re)introduced by a declaration are <em>bound</em> to it in its target scope.</li>
</ol>
<p>An entity <em>belongs</em> to a scope <em>S</em> if <em>S</em> is the target scope of a declaration of the entity. [<em>Note</em>: Special cases include that:</p>
<ol style="list-style-type: decimal">
<li>Template parameter scopes are parents only to other template parameter scopes ([basic.scope.temp]).</li>
<li>Corresponding declarations with appropriate linkage declare the same entity ([basic.link]).</li>
<li>The declaration in a <em>template-declaration</em> inhabits the same scope as the <em>template-declaration</em>.</li>
<li>Friend declarations and declarations of qualified names and template specializations do not bind names ([dcl.meaning]); those with qualified names target a specified scope, and other friend declarations and certain <em>elaborated-type-specifier</em>⁠s ([dcl.type.elab]) target a larger enclosing scope.</li>
<li>Block-scope extern declarations target a larger enclosing scope but bind a name in their immediate scope.</li>
<li>The names of unscoped enumerators are bound in the two innermost enclosing scopes ([dcl.enum]).</li>
<li>A class’s name is also bound in its own scope ([class.pre]).</li>
<li>The names of the members of an anonymous union are bound in the union’s parent scope ([class.union.anon]).</li>
</ol>
<p>— <em>end note</em>]</p>
</blockquote>
<blockquote>
<p>Two declarations <em>correspond</em> if they (re)introduce the same name, both declare constructors, or both declare destructors, unless</p>
<ol style="list-style-type: decimal">
<li>either is a <em>using-declarator</em>, or</li>
<li>one declares a type (not a <em>typedef-name</em>) and the other declares a variable, non-static data member other than of an anonymous union ([class.union.anon]), enumerator, function, or function template, or</li>
<li>each declares a function or function template, except when
<ol style="list-style-type: decimal">
<li>both declare functions with the same parameter-type-list[<em>Footnote</em>: An implicit object parameter ([over.match.funcs]) is not part of the parameter-type-list. — <em>end footnote</em>], equivalent ([temp.over.link]) trailing <em>requires-clause</em>s (if any, except as specified in [temp.friend]), and, if both are non-static members, the same <em>cv</em>-qualifiers (if any) and <em>ref-qualifier</em> (if both have one), or</li>
<li>both declare function templates with equivalent parameter-type-lists, return types (if any), <em>template-head</em>s, and trailing <em>requires-clause</em>s (if any), and, if both are non-static members, the same <em>cv</em>-qualifiers (if any) and <em>ref-qualifier</em> (if both have one).</li>
</ol></li>
</ol>
<p>[<em>Note</em>: Declarations can correspond even if neither binds a name. [<em>Example</em>:</p>
<pre class="sourceCode cpp"><code class="sourceCode cpp"><span class="kw">struct</span> A {
  <span class="kw">friend</span> <span class="dt">void</span> f();    <span class="co">// #1</span>
};
<span class="kw">struct</span> B {
  <span class="kw">friend</span> <span class="dt">void</span> f() {}  <span class="co">// corresponds to, and defines, #1</span>
};</code></pre>
<p>— <em>end example</em>] — <em>end note</em>] [<em>Example</em>:</p>
<pre class="sourceCode cpp"><code class="sourceCode cpp"><span class="kw">typedef</span> <span class="dt">int</span> Int;
<span class="kw">enum</span> E : <span class="dt">int</span> { a };
<span class="dt">void</span> f(<span class="dt">int</span>);       <span class="co">// #1</span>
<span class="dt">void</span> f(Int) {}     <span class="co">// defines #1</span>
<span class="dt">void</span> f(E) {}       <span class="co">// OK: another overload</span>

<span class="kw">struct</span> X {
  <span class="dt">static</span> <span class="dt">void</span> f();
  <span class="dt">void</span> f() <span class="dt">const</span>;  <span class="co">// error: redeclaration</span>
  <span class="dt">void</span> g();
  <span class="dt">void</span> g() <span class="dt">const</span>;  <span class="co">// OK</span>
  <span class="dt">void</span> g() &amp;;      <span class="co">// error: redeclaration</span>
};</code></pre>
<p>— <em>end example</em>]</p>
</blockquote>
<blockquote>
<p>Two declarations <em>potentially conflict</em> if they correspond and cause their shared name to denote different entities ([basic.link]). The program is ill-formed if, in any scope, a name is bound to two declarations that potentially conflict and one precedes the other ([basic.lookup]). [<em>Note</em>: Overload resolution can consider potentially conflicting declarations found in multiple scopes (<em>e.g.</em>, via <em>using-directive</em>s or for operator functions), in which case it is often ambiguous. — <em>end note</em>] [<em>Example</em>:</p>
<pre class="sourceCode cpp"><code class="sourceCode cpp"><span class="dt">void</span> f() {
  <span class="dt">int</span> x,y;
  <span class="dt">void</span> x();  <span class="co">// error: different entity for x</span>
  <span class="dt">int</span> y;     <span class="co">// error: redefinition</span>
}
<span class="kw">enum</span> { f };  <span class="co">// error: different entity for ::f</span>
<span class="kw">namespace</span> A {}
<span class="kw">namespace</span> B = A;
<span class="kw">namespace</span> B = A;  <span class="co">// OK: no effect</span>
<span class="kw">namespace</span> B = B;  <span class="co">// OK: no effect</span>
<span class="kw">namespace</span> A = B;  <span class="co">// OK: no effect</span>
<span class="kw">namespace</span> B {}    <span class="co">// error: different entity for B</span></code></pre>
<p>— <em>end example</em>]</p>
</blockquote>
<blockquote>
<p>A declaration is <em>nominable</em> in a class, class template, or namespace <em>E</em> at a point <em>P</em> if it precedes <em>P</em>, it does not inhabit a block scope, and its target scope is the scope associated with <em>E</em> or, if <em>E</em> is a namespace, any element of the inline namespace set of <em>E</em> ([namespace.def]). [<em>Example</em>:</p>
<pre class="sourceCode cpp"><code class="sourceCode cpp"><span class="kw">namespace</span> A {
  <span class="dt">void</span> f() {<span class="dt">void</span> g();}
  <span class="kw">inline</span> <span class="kw">namespace</span> B {
    <span class="kw">struct</span> S {
      <span class="kw">friend</span> <span class="dt">void</span> h();
      <span class="dt">static</span> <span class="dt">int</span> i;
    };
  }
}</code></pre>
<p>At the end of this example, the declarations of <code>f</code>, <code>B</code>, <code>S</code>, and <code>h</code> are nominable in <code>A</code>, but those of <code>g</code> and <code>i</code> are not. — <em>end example</em>]</p>
</blockquote>
<blockquote>
<p>When instantiating a templated entity ([temp.pre]), any scope <em>S</em> introduced by any part of the template definition is considered to be introduced by the instantiated entity and to contain the instantiations of any declarations that inhabit <em>S</em>.</p>
</blockquote>
</div>
<h4 id="basic.scope.pdecl">#[basic.scope.pdecl]</h4>
<p>Change each paragraph 1–12: <!-- No > here; these are paragraph numbers. --></p>
<ol style="list-style-type: decimal">
<li><p>The <s><em>point of declaration</em> for</s><u><em>locus</em> of</u> a <s>name</s><u>declaration ([basic.pre]) that is a declarator</u> is immediately after <s>its</s><u>the</u> complete declarator ([dcl.decl])<s> and before its initializer (if any), except as noted below</s>. [<em>Example</em>:</p>
[…] — <em>end example</em>]</li>
<li><p>[<em>Note</em>: A name from an outer scope remains visible up to the <s>point</s><u>locus</u> of <u>the </u>declaration<s> of the name</s> that hides it. [<em>Example</em>:</p>
[…] — <em>end example</em>] — <em>end note</em>]</li>
<li>The <s>point</s><u>locus</u> of<s> declaration for a class or class template first declared by</s> a <em>class-specifier</em> is immediately after the <em>identifier</em> or <em>simple-template-id</em> (if any) in its <em>class-head</em> ([class.pre]). The <s>point</s><u>locus</u> of <s>declaration for an enumeration</s><u>an <em>enum-specifier</em> or <em>opaque-enum-declaration</em></u> is immediately after the <em>identifier</em> (if any) in <s>either its <em>enum-specifier</em> ([dcl.enum]) or its first <em>opaque-enum-declaration</em></s><u>it</u> ([dcl.enum])<s>, whichever comes first</s>. The <s>point</s><u>locus</u> of <s>declaration of an alias or alias template</s><u>an <em>alias-declaration</em> is</u> immediately <s>follows the <em>defining-type-id</em> to which the alias refers</s><u>after it</u>.</li>
<li>The <s>point of declaration</s><u>locus</u> of a <em>using-declarator</em> that does not name a constructor is immediately after the <em>using-declarator</em> ([namespace.udecl]).</li>
<li><p>The <s>point of declaration for an enumerator</s><u>locus of an <em>enumerator-definition</em></u> is immediately after it<s>s enumerator-definition</s>. [<em>Example</em>:</p>
[…] — <em>end example</em>]</li>
<li><u>[<em>Note</em>: </u>After the <s>point of </s>declaration of a class member, the member name can be <s>looked up</s><u>found</u> in the scope of its class<s>. [<em>Note</em>: This is true</s> even if the class is an incomplete class. […] — <em>end note</em>]</li>
<li><s>[…]</s><u>The locus of an <em>elaborated-type-specifier</em> that is a declaration ([dcl.type.elab]) is immediately after it.</u></li>
<li>The <s>point of declaration for</s><u>locus of</u> an injected-class-name<u> declaration</u> ([class.pre]) is immediately following the opening brace of the class definition.</li>
<li>The <s>point</s><u>locus</u> of<u> the implicit</u> declaration <s>for</s><u>of</u> a function-local predefined variable ([dcl.fct.def.general]) is immediately before the <em>function-body</em> of <s>a</s><u>its</u> function<u>’s</u> definition.</li>
<li>The <s>point</s><u>locus</u> of<u> the</u> declaration of a structured binding ([dcl.struct.bind]) is immediately after the <em>identifier-list</em> of the structured binding declaration.</li>
<li>The <s>point of declaration for the variable or the structured bindings declared in the</s><u>locus of a</u> for-range-declaration of a range-based for statement ([stmt.ranged]) is immediately after the <em>for-range-initializer</em>.</li>
<li><p>The <s>point of declaration for a template parameter</s><u>locus of a <em>template-parameter</em></u> is immediately after it<s>s complete <em>template-parameter</em></s>. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p></li>
</ol>
<p>Insert before paragraph 13:</p>
<div class="ins">
<blockquote>
<p>The locus of a <em>concept-definition</em> is immediately after its <em>concept-name</em> ([temp.concept]). [<em>Note</em>: The <em>constraint-expression</em> cannot use the <em>concept-name</em>. — <em>end note</em>]</p>
</blockquote>
<blockquote>
<p>The locus of a <em>namespace-definition</em> with an <em>identifier</em> is immediately after the <em>identifier</em>. [<em>Note</em>: An identifier is invented for an <em>unnamed-namespace-definition</em> ([namespace.unnamed]). — <em>end note</em>]</p>
</blockquote>
</div>
<p>[<em>Drafting note</em>: There is no normative wording yet corresponding to the <em>constraint-expression</em> note. — <em>end drafting note</em>]</p>
<p>Change paragraph 13:</p>
<blockquote>
<p>[<em>Note</em>: Friend declarations <s>refer to</s><u>may introduce</u> functions or classes that <s>are members of</s><u>belong to</u> the nearest enclosing namespace<u> or block scope</u>, but they do not <s>introduce new</s><u>bind</u> names <s>into that namespace</s><u>anywhere</u> ([<s>namespace.memdef</s><u>class.friend</u>]). Function declarations at block scope and variable declarations with the <code>extern</code> specifier at block scope <s>refer to declarations that are members of an</s><u>declare entities that belong to the nearest</u> enclosing namespace, but they do not <s>introduce new</s><u>bind</u> names <s>into that scope</s><u>in it</u>. — <em>end note</em>]</p>
</blockquote>
<h4 id="basic.scope.block">#[basic.scope.block]</h4>
<div class="del">
Replace contents, retaining the example:
</div>
<div class="ins">
<blockquote>
<p>Each</p>
<ol style="list-style-type: decimal">
<li>selection or iteration statement ([stmt.select], [stmt.iter]),</li>
<li>substatement of such a statement,</li>
<li><em>handler</em> ([except.pre]), or</li>
<li>compound statement ([stmt.block]) that is not the <em>compound-statement</em> of a <em>handler</em>,</li>
</ol>
<p>introduces a <em>block scope</em> that includes that statement or <em>handler</em>. [<em>Note</em>: A substatement that is also a block has only one scope. — <em>end note</em>] A variable that belongs to a block scope is a <em>block variable</em>.</p>
</blockquote>
</div>
<div class="mv">
<p>Move the example from [stmt.for]/3 to here.</p>
</div>
<div class="ins">
<blockquote>
<p>If a declaration whose target scope is the block scope <em>S</em> of a</p>
<ol style="list-style-type: decimal">
<li><em>compound-statement</em> of a <em>lambda-expression</em>, <em>function-body</em>, or <em>function-try-block</em>,</li>
<li>substatement of a selection or iteration statement, or</li>
<li><em>handler</em> of a <em>function-try-block</em></li>
</ol>
<p>potentially conflicts with a declaration whose target scope is the parent scope of <em>S</em>, the program is ill-formed. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
</div>
<h4 id="basic.scope.param">#[basic.scope.param]</h4>
<div class="del">
Replace contents:
</div>
<div class="ins">
<blockquote>
<p>A <em>parameter-declaration-clause</em> <em>P</em> introduces a <em>function parameter scope</em> that includes <em>P</em>. [<em>Note</em>: A function parameter cannot be used for its value within the <em>parameter-declaration-clause</em> ([dcl.fct.default]). — <em>end note</em>] If <em>P</em> is associated with a <em>declarator</em> and is preceded by a (possibly-parenthesized) <em>noptr-declarator</em> of the form <em>declarator-id</em> <em>attribute-specifier-seq</em><sub><em>opt</em></sub>, its scope extends to the end of the nearest enclosing <em>init-declarator</em>, <em>member-declarator</em>, <em>declarator</em> of a <em>parameter-declaration</em> or a <em>nodeclspec-function-declaration</em>, or <em>function-definition</em>, but does not include the locus of the associated <em>declarator</em>. [<em>Note</em>: In this case, <em>P</em> declares the parameters of a function (or a function or template parameter declared with function type). A member function’s parameter scope is nested within its class’s scope. — <em>end note</em>] If <em>P</em> is associated with a <em>lambda-declarator</em>, its scope extends to the end of the <em>compound-statement</em> in the <em>lambda-expression</em>. If <em>P</em> is associated with a <em>requirement-parameter-list</em>, its scope extends to the end of the <em>requirement-body</em> of the <em>requires-expression</em>. If <em>P</em> is associated with a <em>deduction-guide</em>, its scope extends to the end of the <em>deduction-guide</em>.</p>
</blockquote>
</div>
<div class="del">
<h4>#[basic.funscope]</h4>
</div>
<p>Remove subclause, referring the stable name (which has no cross references) to [stmt.label].</p>
<h4 id="basic.scope.namespace">#[basic.scope.namespace]</h4>
<div class="del">
Replace contents, adapting the example from [namespace.def]/4:
</div>
<div class="ins">
<blockquote>
<p>Any <em>namespace-definition</em> for a namespace <em>N</em> introduces a <em>namespace scope</em> that includes the <em>namespace-body</em> for every <em>namespace-definition</em> for <em>N</em>. For each non-friend redeclaration or specialization whose target scope is or is contained by the scope, the portion after the <em>declarator-id</em>, <em>class-head-name</em>, or <em>enum-head-name</em> is also included in the scope. The global scope is the namespace scope of the global namespace ([basic.namespace]). [<em>Example</em>:</p>
<pre class="sourceCode cpp"><code class="sourceCode cpp"><span class="kw">namespace</span> Q {
  <span class="kw">namespace</span> V { <span class="dt">void</span> f(); }
  <span class="dt">void</span> V::f() {  <span class="co">// in the scope of V</span>
    <span class="dt">void</span> h();    <span class="co">// declares Q::V::h</span>
  }
}</code></pre>
<p>— <em>end example</em>]</p>
</blockquote>
</div>
<h4 id="basic.scope.class">#[basic.scope.class]</h4>
<div class="del">
Replace contents:
</div>
<div class="ins">
<blockquote>
<p>Any declaration of a class or class template <em>C</em> introduces a <em>class scope</em> that includes the <em>member-specification</em> of the <em>class-specifier</em> for <em>C</em> (if any). For each non-friend redeclaration or specialization whose target scope is or is contained by the scope, the portion after the <em>declarator-id</em>, <em>class-head-name</em>, or <em>enum-head-name</em> is also included in the scope. [<em>Note</em>: Lookup from a program point before the <em>class-specifier</em> of a class will find no bindings in the class scope. [<em>Example</em>:</p>
<pre class="sourceCode cpp"><code class="sourceCode cpp"><span class="kw">template</span>&lt;<span class="kw">class</span> D&gt;
<span class="kw">struct</span> B {
  D::type x;           <span class="co">// #1</span>
};

<span class="kw">struct</span> A {<span class="kw">using</span> type=<span class="dt">int</span>;};
<span class="kw">struct</span> C : A,B&lt;C&gt; {};  <span class="co">// error at #1: C::type not found</span></code></pre>
<p>— <em>end example</em>] — <em>end note</em>]</p>
</blockquote>
</div>
<h4 id="basic.scope.enum">#[basic.scope.enum]</h4>
<div class="del">
Replace contents:
</div>
<div class="ins">
<blockquote>
<p>Any declaration of an enumeration <em>E</em> introduces an <em>enumeration scope</em> that includes the <em>enumerator-list</em> of the <em>enum-specifier</em> for <em>E</em> (if any).</p>
</blockquote>
</div>
<h4 id="basic.scope.temp">#[basic.scope.temp]</h4>
<div class="del">
Replace contents:
</div>
<div class="ins">
<blockquote>
<p>Each template <em>template-parameter</em> introduces a <em>template parameter scope</em> that includes the <em>template-head</em> of the <em>template-parameter</em>.</p>
</blockquote>
<blockquote>
<p>Each <em>template-declaration</em> <em>D</em> introduces a template parameter scope that extends from the beginning of its <em>template-parameter-list</em> to the end of the <em>template-declaration</em>. Any declaration outside the <em>template-parameter-list</em> that would inhabit that scope instead inhabits the same scope as <em>D</em>. The parent scope of any scope <em>S</em> that is not a template parameter scope is the smallest scope that contains <em>S</em> and is not a template parameter scope. [<em>Note</em>: Therefore, only template parameters belong to a template parameter scope, and only template parameter scopes have a template parameter scope as a parent scope. — <em>end note</em>]</p>
</blockquote>
</div>
<div class="del">
<h4>#[basic.scope.hiding]</h4>
</div>
<p>Remove subclause, referring the stable name to [basic.lookup].</p>
<h3 id="basic.lookup">#[basic.lookup]</h3>
<p>Change paragraph 1:</p>
<blockquote>
<p>[…] Name lookup associates the use of a name with a set of declarations ([basic.def]) of that name. <u>Unless otherwise specified, the program is ill-formed if no declarations are found.</u> If the declarations found by name lookup all denote functions or function templates, the declarations are said to form an <em>overload set</em>. <s>The</s><u>Otherwise, if the</u> declarations found by name lookup <s>shall either</s><u>do not</u> all denote the same entity<s> or form an overload set</s><u>, they are <em>ambiguous</em> and the program is ill-formed</u>. Overload resolution ([over.match], [over.over]) takes place after name lookup has succeeded. The access rules ([class.access]) are considered only once name lookup and function overload resolution (if applicable) have succeeded. Only after name lookup, function overload resolution (if applicable) and access checking have succeeded are the semantic properties introduced by the <s>name’s </s>declaration<u>s</u><s> and its reachable ([module.reach]) redeclarations</s> used <u>in </u>further <s>in expression </s>processing<s> ([expr])</s>.</p>
</blockquote>
<p>Insert before paragraph 2:</p>
<div class="ins">
<blockquote>
<p>A program point <em>P</em> is said to follow any declaration in the same translation unit whose locus ([basic.scope.pdecl]) is before <em>P</em>. [<em>Note</em>: The declaration might appear in a scope that does not contain <em>P</em>. — <em>end note</em>] A declaration <em>X</em> <em>precedes</em> a program point <em>P</em> in a translation unit <em>L</em> if <em>P</em> follows <em>X</em>, <em>X</em> inhabits a class scope and is reachable from <em>P</em>, or else <em>X</em> appears in a translation unit <em>D</em> and</p>
<ol style="list-style-type: decimal">
<li><em>P</em> follows a <em>module-import-declaration</em> or <em>module-declaration</em> that imports <em>D</em> (directly or indirectly), and</li>
<li><em>X</em> appears after the <em>module-declaration</em> in <em>D</em> (if any) and before the <em>private-module-fragment</em> in <em>D</em> (if any), and</li>
<li>either <em>X</em> is exported or else <em>D</em> and <em>L</em> are part of the same module and <em>X</em> does not inhabit a namespace with internal linkage or declare a name with internal linkage. [<em>Note</em>: Names declared by a <em>using-declaration</em> have no linkage. — <em>end note</em>]</li>
</ol>
</blockquote>
</div>
<div class="mv">
<p>Move the note (and example) from [basic.scope.namespace]/2 to the end of this paragraph.</p>
</div>
<p>Replace paragraphs 2 through 4:</p>
<div class="del">
<blockquote>
<p>A name “looked up in the context of an expression” is looked up in the scope where the expression is found.</p>
</blockquote>
<blockquote>
<p>The injected-class-name of a class ([class.pre]) is also considered to be a member of that class for the purposes of name hiding and lookup.</p>
</blockquote>
<blockquote>
<p>[<em>Note</em>: [basic.link] discusses linkage issues. The notions of scope, point of declaration and name hiding are discussed in [basic.scope]. — <em>end note</em>]</p>
</blockquote>
</div>
<div class="ins">
<blockquote>
<p>A <em>single search</em> in a scope <em>S</em> for a name <em>N</em> from a program point <em>P</em> finds all declarations that precede <em>P</em> to which any name that is the same as <em>N</em> ([basic.pre]) is bound in <em>S</em>. If any such declaration is a <em>using-declarator</em> whose terminal name ([expr.prim.id.unqual]) is not dependent ([temp.dep.type]), it is replaced by the declarations named by the <em>using-declarator</em> ([namespace.udecl]).</p>
</blockquote>
<blockquote>
<p>In certain contexts, only certain kinds of declarations are included. After any such restriction, any declarations of classes or enumerations are discarded if any other declarations are found. [<em>Note</em>: A type (but not a <em>typedef-name</em> or template) is therefore hidden by any other entity in its scope. — <em>end note</em>] However, if a lookup is <em>type-only</em>, only declarations of types and templates whose specializations are types are considered; furthermore, if declarations of a <em>typedef-name</em> and of the type to which it refers are found, the declaration of the <em>typedef-name</em> is discarded instead of the type declaration.</p>
</blockquote>
</div>
<h4 id="class.member.lookup">#[class.member.lookup]</h4>
<p>Move to front of [basic.lookup], editing as follows:</p>
<p>Remove paragraph 1:</p>
<div class="del">
<blockquote>
<p>Member name lookup determines the meaning […]</p>
</blockquote>
</div>
<p>Change paragraph 2:</p>
<blockquote>
<p><s>The</s><u>A <em>search</em> in a scope <em>X</em> for a name <em>N</em> from a program point <em>P</em> is a single search in <em>X</em> for <em>N</em> from <em>P</em> unless <em>X</em> is the scope of a class or class template <em>T</em>, in which case the</u> following steps define the result of <s>a member name <code>f</code> in a class scope <code>C</code></s><u>the search</u>. <u>[<em>Note</em>: The result differs only if <em>N</em> is a <em>conversion-function-id</em> or if the single search would find nothing. — <em>end note</em>]</u></p>
</blockquote>
<p>Replace <code>f</code> with <em>N</em> and <code>C</code> with <em>C</em> in the following paragraphs.</p>
<p>Change paragraph 3:</p>
<blockquote>
<p>The <em>lookup set</em> for <s><code>f</code></s><u><em>N</em></u> in <s><code>C</code></s><u><em>C</em></u>, called <em>S</em>(<em><s>f</s><u>N</u></em>,<em>C</em>), consists of two component sets: the <em>declaration set</em>, a set of members named <s><code>f</code></s><u><em>N</em></u>; and the <em>subobject set</em>, a set of subobjects where declarations of these members<s> (possibly including <em>using-declaration</em>⁠s)</s> were found<u> (possibly via <em>using-declaration</em>⁠s)</u>. In the declaration set, <s><em>using-declaration</em>⁠s are replaced by the set of designated members that are not hidden or overridden by members of the derived class ([namespace.udecl]), and </s>type declarations (including injected-class-names) are replaced by the types they designate. <em>S</em>(<em><s>f</s><u>N</u></em>,<em>C</em>) is calculated as follows:</p>
</blockquote>
<p>Change paragraph 4:</p>
<blockquote>
<p><s>If <code>C</code> contains a declaration of the name <code>f</code>, the declaration set contains every declaration of <code>f</code> declared in <code>C</code> that satisfies the requirements of the language construct in which the lookup occurs.</s> <u>The declaration set is the result of a single search in the scope of <em>C</em> for <em>N</em> from immediately after the <em>class-specifier</em> of <em>C</em> if <em>P</em> is in a complete-class context of <em>C</em> or from <em>P</em> otherwise.</u> <s>[<em>Note</em>: […] — <em>end note</em>]</s> […]</p>
</blockquote>
<p>[<em>Drafting note</em>: The plan for CWG2335 is to describe forbidden dependency cycles among the complete-class contexts of a class. — <em>end drafting note</em>]</p>
<p>Change paragraph 5:</p>
<blockquote>
<p>[…] <s>If <code>C</code> has base classes, c</s><u>C</u>alculate the lookup set for <s><code>f</code></s><u><em>N</em></u> in each direct <u>non-dependent ([temp.dep.type]) </u>base class subobject <em>B<sub>i</sub></em>, and merge each such lookup set <em>S</em>(<em><s>f</s><u>N</u></em>,<em>B<sub>i</sub></em>) in turn into <em>S</em>(<em><s>f</s><u>N</u></em>,<em>C</em>). <u>[<em>Note</em>: If <em>T</em> is incomplete, only base classes whose <em>base-specifier</em> appears before <em>P</em> are considered. If <em>T</em> is an instantiated class, its base classes are not dependent. — <em>end note</em>]</u></p>
</blockquote>
<p>Change paragraph 7:</p>
<blockquote>
<p>The result of <s>name lookup for <code>f</code> in <code>C</code></s><u>the search</u> is the declaration set of <em>S</em>(<em><s>f</s><u>N</u></em>,<em><s>C</s><u>T</u></em>). If it is an invalid set, the program is ill-formed. <u>If it differs from the result of a search in <em>T</em> for <em>N</em> from immediately after the <em>class-specifier</em> of <em>T</em>, the program is ill-formed, no diagnostic required.</u> [<em>Example</em>:</p>
<p>[…]</p>
<p><em>S</em>(<s><em>x</em></s><u><code>x</code></u>,<s><em>F</em></s><u><code>F</code></u>) is unambiguous because the <code>A</code> and <code>B</code> base class subobjects of <code>D</code> are also base class subobjects of <code>E</code>, so <em>S</em>(<s><em>x</em></s><u><code>x</code></u>,<s><em>D</em></s><u><code>D</code></u>) is discarded in the first merge step. — <em>end example</em>]</p>
</blockquote>
<p>Replace paragraph 8:</p>
<div class="del">
<blockquote>
<p>If the name of an overloaded function is unambiguously found, […]</p>
</blockquote>
</div>
<div class="ins">
<blockquote>
<p>If <em>N</em> is a non-dependent <em>conversion-function-id</em>, conversion function templates that are members of <em>T</em> are considered. For each such template <em>F</em>, the lookup set <em>S</em>(<em>t</em>,<em>T</em>) is constructed, considering a function template declaration to have the name <em>t</em> only if it corresponds to a declaration of <em>F</em> ([basic.scope.scope]). The members of the declaration set of each such lookup set, which shall not be an invalid set, are included in the result. [<em>Note</em>: Overload resolution will discard those that cannot convert to the type specified by <em>N</em> ([temp.over]). — <em>end note</em>]</p>
</blockquote>
</div>
<h4 id="basic.lookup.unqual">#[basic.lookup.unqual]</h4>
<div class="del">
Replace contents:
</div>
<div class="ins">
<blockquote>
<p>A <em>using-directive</em> is active in a scope <em>S</em> at a program point <em>P</em> if it precedes <em>P</em> and inhabits either <em>S</em> or the scope of a namespace nominated by a <em>using-directive</em> that is active in <em>S</em> at <em>P</em>. [<em>Note</em>: A <em>using-directive</em> is exported if and only if it appears in a header unit. — <em>end note</em>]</p>
</blockquote>
<blockquote>
<p>An unqualified search in a scope <em>S</em> from a program point <em>P</em> includes the results of searches from <em>P</em> in</p>
<ol style="list-style-type: decimal">
<li><em>S</em>, and</li>
<li>for any scope <em>U</em> that contains <em>P</em> and is or is contained by <em>S</em>, each namespace contained by <em>S</em> that is nominated by a <em>using-directive</em> that is active in <em>U</em> at <em>P</em>.</li>
</ol>
<p>If no declarations are found, the results of the unqualified search are the results of an unqualified search in the parent scope of <em>S</em>, if any, from <em>P</em>. [<em>Note</em>: When a class scope is searched, the scopes of its base classes are also searched ([class.member.lookup]). If it inherits from a single base, it is as if the scope of the base immediately contains the scope of the derived class. Template parameter scopes that are associated with one scope in the chain of parents are also considered ([temp.local]). — <em>end note</em>]</p>
</blockquote>
<blockquote>
<p><em>Unqualified name lookup</em> from a program point performs an unqualified search in its immediate scope.</p>
</blockquote>
<blockquote>
<p>An <em>unqualified name</em> is a name that does not follow a <em>nested-name-specifier</em> or the <code>.</code> or <code>-&gt;</code> in a class member access expression ([expr.ref]), possibly after a <code>template</code> keyword or <code>~</code>. Unless otherwise specified, such a name undergoes unqualified name lookup from the point where it appears.</p>
</blockquote>
<blockquote>
<p>An unqualified name that is a component name ([expr.prim.id.unqual]) of a <em>type-specifier</em> or <em>ptr-operator</em> of a <em>conversion-type-id</em> is looked up in the same fashion as the <em>conversion-function-id</em> in which it appears. If that lookup finds nothing, it undergoes unqualified name lookup; in each case, only names that denote types or templates whose specializations are types are considered.<!-- remote --></p>
</blockquote>
<blockquote>
<p>In a friend declaration <em>declarator</em> whose <em>declarator-id</em> is a <em>qualified-id</em> whose lookup context is ([basic.lookup.qual]) a class or namespace <em>S</em>, lookup for an unqualified name that appears after the <em>declarator-id</em> performs a search in the scope associated with <em>S</em>. If that lookup finds nothing, it undergoes unqualified name lookup. [<em>Example</em>:</p>
<pre class="sourceCode cpp"><code class="sourceCode cpp"><span class="kw">using</span> I=<span class="dt">int</span>;
<span class="kw">using</span> D=<span class="dt">double</span>;
<span class="kw">namespace</span> A {
  <span class="kw">inline</span> <span class="kw">namespace</span> N {<span class="kw">using</span> C=<span class="dt">char</span>;}
  <span class="kw">using</span> F=<span class="dt">float</span>;
  <span class="dt">void</span> f(I);
  <span class="dt">void</span> f(D);
  <span class="dt">void</span> f(C);
  <span class="dt">void</span> f(F);
}
<span class="kw">struct</span> X0 {<span class="kw">using</span> F=<span class="dt">float</span>;};
<span class="kw">struct</span> W {
  <span class="kw">using</span> D=<span class="dt">void</span>;
  <span class="kw">struct</span> X : X0 {
    <span class="dt">void</span> g(I);
    <span class="dt">void</span> g(::D);
    <span class="dt">void</span> g(F);
  };
};
<span class="kw">namespace</span> B {
  <span class="kw">typedef</span> <span class="dt">short</span> I,F;
  <span class="kw">class</span> Y {
    <span class="kw">friend</span> <span class="dt">void</span> A::f(I);  <span class="co">// error: no void A::f(short)</span>
    <span class="kw">friend</span> <span class="dt">void</span> A::f(D);  <span class="co">// OK</span>
    <span class="kw">friend</span> <span class="dt">void</span> A::f(C);  <span class="co">// error: A::N::C not found</span>
    <span class="kw">friend</span> <span class="dt">void</span> A::f(F);  <span class="co">// OK</span>
    <span class="kw">friend</span> <span class="dt">void</span> X::g(I);  <span class="co">// error: no void X::g(short)</span>
    <span class="kw">friend</span> <span class="dt">void</span> X::g(D);  <span class="co">// OK</span>
    <span class="kw">friend</span> <span class="dt">void</span> X::g(F);  <span class="co">// OK</span>
  };
}</code></pre>
<p>— <em>end example</em>]</p>
</blockquote>
</div>
<h4 id="basic.lookup.argdep">#[basic.lookup.argdep]</h4>
<p>Change paragraph 1:</p>
<blockquote>
<p>When the <em>postfix-expression</em> in a function call ([expr.call]) is an <em>unqualified-id</em>, <s>other namespaces not considered during the usual</s><u>and</u> unqualified lookup ([basic.lookup.unqual]) <s>may be searched, and in those namespaces, namespace-scope friend function or function template declarations ([class.friend]) not otherwise visible may be found. These modifications to the search</s><u>for the name in the <em>unqualified-id</em> does not find any</u></p>
<ol style="list-style-type: decimal">
<li><u>declaration of a class member, or</u></li>
<li><u>function declaration inhabiting a block scope, or</u></li>
<li><u>declaration not of a function or function template</u></li>
</ol>
<p><u>then lookup for the name also includes the result of <em>argument-dependent lookup</em> in a set of <em>associated namespaces</em> that</u> depend<u>s</u> on the types of the arguments (and for template template arguments, the namespace of the template argument)<u>, as specified below</u>. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<div class="mv">
<p>Move the note from [basic.lookup.unqual]/3 here, inserting it before paragraph 2.</p>
</div>
<p>Change paragraph 2:</p>
<blockquote>
<p>For each argument type <code>T</code> in the function call, there is <s>a set of zero or more <em>associated namespaces</em> and </s>a set of zero or more <em>associated entities</em><s> (other than namespaces)</s> to be considered. The set<s>s</s> of <s>namespaces and </s>entities <s>are</s><u>is</u> determined entirely by the types of the function arguments (and <s>the namespace of </s>any template template argument<u>s</u>). Typedef names and <em>using-declaration</em>⁠s used to specify the types do not contribute to this set. The set<s>s</s> of <s>namespaces and </s>entities <s>are</s><u>is</u> determined in the following way:</p>
<ol style="list-style-type: decimal">
<li>If <code>T</code> is a fundamental type, its associated set<s>s</s> of <s>namespaces and </s>entities <s>are both</s><u>is</u> empty.</li>
<li>If <code>T</code> is a class type (including unions), its associated entities are: the class itself; the class of which it is a member, if any; and its direct and indirect base classes. <s>Its associated namespaces are the innermost enclosing namespaces of its associated entities.</s> Furthermore, if <code>T</code> is a class template specialization, its associated <s>namespaces and </s>entities also include: the <s>namespaces and </s>entities associated with the types of the template arguments provided for template type parameters<s> (excluding template template parameters)</s>; the templates used as template template arguments;<s> the namespaces of which any template template arguments are members;</s> and the classes of which any member templates used as template template arguments are members. [<em>Note</em>: Non-type template arguments do not contribute to the set of associated <s>namespaces</s><u>entities</u>. — <em>end note</em>]</li>
<li>If <code>T</code> is an enumeration type, <s>its associated namespace is the innermost enclosing namespace of its declaration, and </s>its associated entities are <code>T</code> and, if it is a class member, the member’s class.</li>
<li>If <code>T</code> is a pointer to <code>U</code> or an array of <code>U</code>, its associated <s>namespaces and </s>entities are those associated with <code>U</code>.</li>
<li>If <code>T</code> is a function type, its associated <s>namespaces and </s>entities are those associated with the function parameter types and those associated with the return type.</li>
<li>If <code>T</code> is a pointer to a member function of a class <code>X</code>, its associated <s>namespaces and </s>entities are those associated with the function parameter types and return type, together with those associated with <code>X</code>.</li>
<li>If <code>T</code> is a pointer to a data member of class <code>X</code>, its associated <s>namespaces and </s>entities are those associated with the member type together with those associated with <code>X</code>.</li>
</ol>
<p><s>If an associated namespace is an inline namespace ([namespace.def]), its enclosing namespace is also included in the set. If an associated namespace directly contains inline namespaces, those inline namespaces are also included in the set.</s> In addition, if the argument is <s>the name or address of </s>an overload set<u> or the address of such a set</u>, its associated entities<s> and namespaces</s> are the union of those associated with each of the members of the set, i.e., the entities<s> and namespaces</s> associated with its parameter types and return type. Additionally, if the aforementioned overload set is named with a <em>template-id</em>, its associated entities<s> and namespaces</s> also include <s>those of its type <em>template-argument</em>⁠s and </s>its template <em>template-argument</em>⁠s<u> and those associated with its type <em>template-argument</em>⁠s</u>.</p>
</blockquote>
<p>Change paragraph 3 and move it to the end of the subclause:</p>
<blockquote>
<p><s>Let <em>X</em> be the lookup set produced by unqualified lookup ([basic.lookup.unqual]) and let <em>Y</em> be the lookup set produced by argument dependent lookup (defined as follows). If <em>X</em> contains</s></p>
<ol style="list-style-type: decimal">
<li><s>a declaration of a class member, or</s></li>
<li><s>a block-scope function declaration that is not a <em>using-declaration</em>, or</s></li>
<li><s>a declaration that is neither a function nor a function template</s></li>
</ol>
<p><s>then <em>Y</em> is empty. Otherwise <em>Y</em> is the set of declarations found in the namespaces associated with the argument types as described below. The set of declarations found by the lookup of the name is the union of <em>X</em> and <em>Y</em>.</s> [<em>Note</em>: The <u>associated </u>namespaces<s> and entities associated with the argument types</s> can include namespaces<s> and entities</s> already considered by <s>the </s>ordinary unqualified lookup. — <em>end note</em>] [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 4:</p>
<blockquote>
<p><s>When considering an</s><u>The associated namespaces for a call are the innermost enclosing non-inline namespaces for its associated entities as well as every element of the inline namespace set of those namespaces. Argument-dependent lookup finds all declarations of functions and function templates that</u></p>
<ol style="list-style-type: decimal">
<li><u>are found by a search of any</u> associated namespace <s><code>N</code></s>, <s>the lookup is the same as the lookup performed when <code>N</code> is used as a qualifier ([namespace.qual]) except that:</s><u>or</u></li>
<li><s>Any <em>using-directive</em>⁠s in <code>N</code> are ignored.</s></li>
<li><s>All names except those of (possibly overloaded) functions and function templates are ignored.</s></li>
<li><s>Any namespace-scope</s><u>are declared as a</u> friend<s> functions or friend function templates</s> ([class.friend]) <s>declared in</s><u>of any</u> class<s>es</s> with <u>a </u>reachable definition<s>s</s> in the set of associated entities<s> are visible within their respective namespaces even if they are not visible during an ordinary lookup ([namespace.memdef]).</s><u>, or</u></li>
<li><s>Any</s><u>are</u> exported <s>declaration <code>D</code> in <code>N</code> declared within the purview of</s><u>, are attached to </u> a named module <code>M</code> ([module.interface])<s> is visible if there is</s><u>, do not appear in the translation unit containing the point of the lookup, and have the same innermost enclosing non-inline namespace scope as a declaration of</u> an associated entity attached to <code>M</code><s> with the same innermost enclosing non-inline namespace as <code>D</code></s>.</li>
</ol>
<p><s>5.</s> If the lookup is for a dependent name ([temp.dep], [temp.dep.candidate]), <s>any declaration <code>D</code> in <code>N</code> is visible if <code>D</code> would be visible to qualified name lookup ([namespace.qual]) at any</s><u>the above lookup is also performed from each</u> point in the instantiation context ([module.context]) of the lookup, <s>unless <code>D</code> is declared</s><u>additionally ignoring any declaration that appears</u> in another translation unit, <u>is </u>attached to the global module, and is either discarded ([module.global.frag]) or has internal linkage.</p>
</blockquote>
<h4 id="basic.lookup.qual">#[basic.lookup.qual]</h4>
<p>Change paragraph 1:</p>
<blockquote>
<p><s>The name of a class or namespace member or enumerator can be referred to after the <code>::</code> scope resolution operator ([expr.prim.id.qual]) applied to a <em>nested-name-specifier</em> that denotes its class, namespace, or enumeration. If</s><u>Lookup of an <em>identifier</em> followed by</u> a <code>::</code> scope resolution operator<s> in a <em>nested-name-specifier</em> is not preceded by a <em>decltype-specifier</em>, lookup of the name preceding that <code>::</code></s> considers only namespaces, types, and templates whose specializations are types.<!-- remote --> If <s>the name found does not</s><u>a name, <em>template-id</em>, or <em>decltype-specifier</em> is followed by a <code>::</code>, it shall</u> designate a namespace<s> or a</s><u>,</u> class, enumeration, or dependent type, <s>the program is ill-formed</s><u>and the <code>::</code> is never interpreted as a complete <em>nested-name-specifier</em></u>. [<em>Example</em>:</p>
<pre class="cpp">
class A {
public:
  static int n;
};
int main() {
  int A;
  A::n = 42;        // OK
  A b;              // error: A does not name a type
}<u>
template&lt;int&gt; struct B : A {};
namespace N {
  template&lt;int&gt; void B();
  int f() {return B&lt;0&gt;::n;}  // error: N::B&lt;0&gt; is not a type
}</u>
</pre>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Replace paragraphs 2 through 5:</p>
<div class="del">
<blockquote>
<p>[<em>Note</em>: Multiply qualified names, […]. — <em>end note</em>]</p>
</blockquote>
<blockquote>
<p>In a declaration in which the <em>declarator-id</em> is a <em>qualified-id</em>, […]</p>
</blockquote>
<blockquote>
<p>A name prefixed by the unary scope operator <code>::</code> ([expr.prim.id.qual]) is looked up in global scope, […]</p>
</blockquote>
<blockquote>
<p>A name prefixed by a <em>nested-name-specifier</em> that nominates an enumeration type shall represent an <em>enumerator</em> of that enumeration.</p>
</blockquote>
</div>
<div class="ins">
<blockquote>
<p>A member-qualified name is the (unique) component name ([expr.prim.id.unqual]), if any, of</p>
<ol style="list-style-type: decimal">
<li>an <em>unqualified-id</em>, or</li>
<li>a <em>nested-name-specifier</em> of the form <em>type-name</em> <code>::</code> or <em>namespace-name</em> <code>::</code>,</li>
</ol>
<p>in the <em>id-expression</em> of a class member access expression ([expr.ref]). A <em>qualified name</em> is a member-qualified name or the terminal name of a <em>qualified-id</em>, a <em>using-declarator</em>, a <em>typename-specifier</em>, a <em>qualified-namespace-specifier</em>, or a <em>nested-name-specifier</em>, <em>elaborated-type-specifier</em>, or <em>class-or-decltype</em> that has a <em>nested-name-specifier</em> ([expr.prim.id.qual]). The <em>lookup context</em> of a member-qualified name is the type of its associated object expression (considered dependent if the object expression is type-dependent). The lookup context of any other qualified name is the type, template, or namespace nominated by the preceding <em>nested-name-specifier</em>. [<em>Note</em>: When parsing a class member access, the name following the <code>-&gt;</code> or <code>.</code> is a qualified name even though it is not yet known of which kind. — <em>end note</em>] [<em>Example</em>: In</p>
<pre class="sourceCode cpp"><code class="sourceCode cpp">N::C::m.Base::f()</code></pre>
<p><code>Base</code> is a member-qualified name; the other qualified names are <code>C</code>, <code>m</code>, and <code>f</code>. — <em>end example</em>]</p>
</blockquote>
<blockquote>
<p><em>Qualified name lookup</em> in a class, namespace, or enumeration performs a search of the scope associated with it ([class.member.lookup]) except as specified below. Unless otherwise specified, a qualified name undergoes qualified name lookup in its lookup context from the point where it appears unless the lookup context either is dependent and is not the current instantiation ([temp.dep.type]) or is not a class or class template. If nothing is found by qualified lookup for a member-qualified name that is the terminal name of a <em>nested-name-specifier</em> and is not dependent, it undergoes unqualified lookup. [<em>Note</em>: During lookup for a template specialization, no names are dependent. — <em>end note</em>] [<em>Example</em>:</p>
<pre class="sourceCode cpp"><code class="sourceCode cpp"><span class="dt">int</span> f();
<span class="kw">struct</span> A {
  <span class="dt">int</span> B,C;
  <span class="kw">template</span>&lt;<span class="dt">int</span>&gt; <span class="kw">using</span> D=<span class="dt">void</span>;
  <span class="kw">using</span> T=<span class="dt">void</span>;
  <span class="dt">void</span> f();
};
<span class="kw">using</span> B=A;
<span class="kw">template</span>&lt;<span class="dt">int</span>&gt; <span class="kw">using</span> C=A;
<span class="kw">template</span>&lt;<span class="dt">int</span>&gt; <span class="kw">using</span> D=A;
<span class="kw">template</span>&lt;<span class="dt">int</span>&gt; <span class="kw">using</span> X=A;

<span class="kw">template</span>&lt;<span class="kw">class</span> T&gt;
<span class="dt">void</span> g(T *p) {            <span class="co">// as instantiated for g&lt;A&gt;:</span>
  p-&gt;X&lt;<span class="dv">0</span>&gt;::f();           <span class="co">// error: A::X not found in ((p-&gt;X) &lt; 0) &gt; ::f()</span>
  p-&gt;<span class="kw">template</span> X&lt;<span class="dv">0</span>&gt;::f();  <span class="co">// OK: ::X found in definition context</span>
  p-&gt;B::f();              <span class="co">// OK: non-type A::B ignored</span>
  p-&gt;<span class="kw">template</span> C&lt;<span class="dv">0</span>&gt;::f();  <span class="co">// error: A::C is not a template</span>
  p-&gt;<span class="kw">template</span> D&lt;<span class="dv">0</span>&gt;::f();  <span class="co">// error: A::D&lt;0&gt; is not a class type</span>
  p-&gt;T::f();              <span class="co">// error: A::T is not a class type</span>
}
<span class="kw">template</span> <span class="dt">void</span> g(A*);</code></pre>
<p>— <em>end example</em>]</p>
</blockquote>
</div>
<p>Change paragraph 6:</p>
<blockquote>
<p><s>In a <em>qualified-id</em> of the form:</s></p>
<blockquote>
<p><s><em>nested-name-specifier</em><sub><em>opt</em></sub> <em>type-name</em> <code>::</code> <code>~</code> <em>type-name</em></s></p>
</blockquote>
<p><s>the second <em>type-name</em> is looked up in the same scope as the first.</s> <u>If a qualified name <em>Q</em> follows a <code>~</code>:</u></p>
<ol style="list-style-type: decimal">
<li><u>If <em>Q</em> is a member-qualified name, it undergoes unqualified lookup as well as qualified lookup.</u></li>
<li><u>Otherwise, its <em>nested-name-specifier</em> <em>N</em> shall nominate a type.</u> <u>If <em>N</em> has another <em>nested-name-specifier</em> <em>S</em>, <em>Q</em> is looked up as if its lookup context were that nominated by <em>S</em>.</u></li>
<li><u>Otherwise, if the terminal name of <em>N</em> is a member-qualified name <em>M</em>, <em>Q</em> is looked up as if <code>~</code><em>Q</em> appeared in place of <em>M</em> (as above).</u></li>
<li><u>Otherwise, <em>Q</em> undergoes unqualified lookup.</u></li>
<li><u>Each lookup for <em>Q</em> considers only types (if <em>Q</em> is not followed by a <code>&lt;</code>) and templates whose specializations are types.</u> <u>If it finds nothing or is ambiguous, it is discarded.</u></li>
<li><u>The <em>type-name</em> that is or contains <em>Q</em> shall refer to its (original) lookup context (ignoring <em>cv</em>-qualification) under the interpretation established by at least one (successful) lookup performed.</u></li>
</ol>
[<em>Example</em>:
<pre class="cpp">
struct C {
  typedef int I;
};
typedef int I1, I2;
extern int* p;
extern int* q;
<u>void f() {
  </u>p->C::I::~I();   <s>  </s>// I is looked up in the scope of C
<u>  </u>q->I1::~I2();     <s>  </s>// I2 <s>is</s><u>found by unqualified</u> look<s>ed </s>up<s> in the scope of the postfix-expression</s><u>
}</u>

struct A {
  ~A();
};
typedef A AB;
int main() {
  AB* p;
  p->AB::~AB();     // explicitly calls the destructor for A
}
</pre>
<p>— <em>end example</em>] <s>[<em>Note</em>: [basic.lookup.classref] describes how name lookup proceeds after the <code>.</code> and <code>-&gt;</code> operators. — <em>end note</em>]</s></p>
</blockquote>
<h5 id="class.qual">#[class.qual]</h5>
<p>Remove paragraph 1:</p>
<div class="del">
<blockquote>
<p>If the <em>nested-name-specifier</em> of a <em>qualified-id</em> nominates a class, […]</p>
</blockquote>
</div>
<p>Change paragraph 2:</p>
<blockquote>
<p>In a lookup <u>for a qualified name whose lookup context is a class <code>C</code> </u>in which function names are not ignored<sup>[…]</sup><s> and the <em>nested-name-specifier</em> nominates a class <code>C</code></s>:</p>
<ol style="list-style-type: decimal">
<li>if the <s>name specified after the <em>nested-name-specifier</em>, when looked up in <code>C</code>, is</s><u>search finds</u> the injected-class-name of <code>C</code> ([class.pre]), or</li>
<li><s>in</s><u>if the qualified name is dependent and is the terminal name of</u> a <em>using-declarator</em><s> of a <em>using-declaration</em></s> ([namespace.udecl]) that <s>is a <em>member-declaration</em>, if the name specified after the <em>nested-name-specifier</em> is the same as the <em>identifier</em> or the <em>simple-template-id</em>’s <em>template-name</em> in the last component of the <em>nested-name-specifier</em></s><u>names a constructor</u>,</li>
</ol>
<p>the name is instead considered to name the constructor of class <code>C</code>. <s>[<em>Note</em>: For example, the constructor is not an acceptable lookup result in an <em>elaborated-type-specifier</em> so the constructor would not be used in place of the injected-class-name. — <em>end note</em>]</s> Such a constructor name shall be used only in the <em>declarator-id</em> of a <u>(friend) </u>declaration <s>that names</s><u>of</u> a constructor or in a <em>using-declaration</em>. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Remove paragraph 3:</p>
<div class="del">
<blockquote>
<p>A class member name hidden by a name in a nested declarative region […]</p>
</blockquote>
</div>
<h5 id="namespace.qual">#[namespace.qual]</h5>
<p>Remove paragraphs 1 and 2:</p>
<div class="del">
<blockquote>
<p>If the <em>nested-name-specifier</em> of a <em>qualified-id</em> nominates a namespace […]</p>
</blockquote>
<blockquote>
<p>For a namespace <code>X</code> and name <code>m</code>, […]</p>
</blockquote>
</div>
<p>Replace paragraph 3, retaining its example:</p>
<div class="del">
<blockquote>
<p>Given <code>X::m</code> (where <code>X</code> is a user-declared namespace), […]</p>
</blockquote>
</div>
<div class="ins">
<blockquote>
<p>Qualified name lookup in a namespace <em>N</em> additionally searches every element of the inline namespace set of <em>N</em> ([namespace.def]). If nothing is found, the results of the lookup are the results of qualified name lookup in each namespace nominated by a <em>using-directive</em> that precedes the point of the lookup and inhabits <em>N</em> or an element of its inline namespace set. [<em>Note</em>: If a <em>using-directive</em> refers to a namespace that has already been considered, it does not affect the result. — <em>end note</em>] [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
</div>
<p>Change paragraph 6:</p>
<blockquote>
<p><s>During the lookup of a qualified namespace member name, if the lookup finds more than one declaration of the member, and if one declaration introduces a c</s><u>[<em>Note</em>: C</u>lass <s>name or</s><u>and</u> enumeration <s>name and the</s><u>declarations are not discarded because of</u> other declarations <s>introduce either the same variable, the same enumerator, or a set of functions, the non-type name hides the class or enumeration name if and only if the declarations are from the same namespace; otherwise (the declarations are from different namespaces), the program is ill-formed</s><u>found in other searches</u>.<u> — <em>end note</em>]</u> [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Remove paragraph 7:</p>
<div class="del">
<blockquote>
<p>In a declaration for a namespace member in which the <em>declarator-id</em> is a <em>qualified-id</em>, […]</p>
</blockquote>
</div>
<h4 id="basic.lookup.elab">#[basic.lookup.elab]</h4>
<p>Remove paragraphs 1 and 2:</p>
<div class="del">
<blockquote>
<p>An <em>elaborated-type-specifier</em> ([dcl.type.elab]) may be used to refer […]</p>
</blockquote>
<blockquote>
<p>If the <em>elaborated-type-specifier</em> has no <em>nested-name-specifier</em>, […]</p>
</blockquote>
</div>
<p>Insert before paragraph 3:</p>
<div class="ins">
<blockquote>
<p>If the <em>class-key</em> or <code>enum</code> keyword in an <em>elaborated-type-specifier</em> is followed by an <em>identifier</em> that is not followed by <code>::</code>, lookup for the <em>identifier</em> is type-only. [<em>Note</em>: In general, the recognition of an <em>elaborated-type-specifier</em> depends on the following tokens. If the <em>identifier</em> is followed by <code>::</code>, see [basic.lookup.qual]. — <em>end note</em>]</p>
</blockquote>
</div>
<p>Change paragraph 3:</p>
<blockquote>
<p>If the <u>terminal name of the </u><em>elaborated-type-specifier</em> <s>has</s><u>is</u> a<s> <em>nested-name-specifier</em>,</s> qualified name<s> lookup is performed, as described in [basic.lookup.qual], but ignoring any non-type names that have been declared</s><u>, lookup for it is type-only</u>. If the name lookup does not find a previously declared <em>type-name</em>, the <em>elaborated-type-specifier</em> is ill-formed.</p>
</blockquote>
<div class="del">
<h4>#[basic.lookup.classref]</h4>
</div>
<p>Remove subclause, referring the stable name to [basic.lookup.qual].</p>
<h3 id="basic.link">#[basic.link]</h3>
<p>Change paragraph 3:</p>
<blockquote>
<p><s>A</s><u>The</u> name <s>having</s><u>of an entity that belongs to a</u> namespace scope ([basic.scope.namespace]) has internal linkage if it is the name of</p>
<p>[…]</p>
</blockquote>
<p>Change paragraph 4:</p>
<blockquote>
<p>An unnamed namespace or a namespace declared directly or indirectly within an unnamed namespace has internal linkage. All other namespaces have external linkage. <s>A</s><u>The</u> name <s>having</s><u>of an entity that belongs to a</u> namespace scope that has not been given internal linkage above and that is the name of</p>
<p>[…]</p>
</blockquote>
<p>Change paragraph 5:</p>
<blockquote>
<p>In addition, a member function, static data member, a named class or enumeration <s>of</s><u>that inhabits a</u> class scope, or an unnamed class or enumeration defined in a <s>class-scope </s>typedef declaration<u> that inhabits a class scope</u> such that the class or enumeration has the typedef name for linkage purposes ([dcl.typedef]), has the same linkage, if any, as the name of the class of which it is a member.</p>
</blockquote>
<p>Change paragraph 6:</p>
<blockquote>
<s>The name of a function declared in block scope and the name of a variable declared by a block scope <code>extern</code> declaration have linkage. If such a declaration is attached to a named module, the program is ill-formed. If there is a visible declaration of an entity with linkage, ignoring entities declared outside the innermost enclosing namespace scope, such that the block scope declaration would be a (possibly ill-formed) redeclaration if the two declarations appeared in the same declarative region, the block scope declaration declares that same entity and receives the linkage of the previous declaration. If there is more than one such matching entity, the program is ill-formed. Otherwise, if no matching entity is found, the block scope entity receives external linkage. If, within a translation unit, the same entity is declared with both internal and external linkage, the program is ill-formed.</s> [<em>Example</em>:
<pre class="cpp">
static void f();
extern "C" void h();
static int i = 0;               // #1
void <s>g</s><u>q</u>() {
  extern void f();              // internal linkage<u>
  extern void g();              // ::g, external linkage</u>
  extern void h();              // C language linkage
  int i;                        // #2: i has no linkage
  {
    extern void f();            // internal linkage
    extern int i;               // #3: <s>ex</s><u>in</u>ternal linkage<s>, ill-formed</s>
  }
}
</pre>

<p><s>Without</s><u>Even though</u> the declaration at line #2<u> hides the declaration at line #1</u>, the declaration at line #3 <s>would link with the</s><u>still</u> <u>re</u>declar<s>ation</s><u>es</u> <s>at line </s>#1<s>. Because the declaration with</s><u> and receives</u> internal linkage<s> is hidden, however, #3 is given external linkage, making the program ill-formed</s>. — <em>end example</em>]</p>
</blockquote>
<p>Remove paragraph 7 (whose example is moved to [dcl.meaning]):</p>
<div class="del">
<blockquote>
<p>When a block scope declaration of an entity with linkage is not found to refer to some other declaration, […]</p>
</blockquote>
</div>
<p>Replace paragraph 9:</p>
<div class="del">
<blockquote>
<p>Two names that are the same ([basic.pre]) and that are declared in different scopes […]</p>
</blockquote>
</div>
<div class="ins">
<blockquote>
<p>Two declarations of entities declare the same entity if, considering declarations of unnamed types to introduce their names for linkage purposes, if any ([dcl.typedef], [dcl.enum]), they correspond ([basic.scope.scope]), have the same target scope that is not a function or template parameter scope, and either</p>
<ol style="list-style-type: decimal">
<li>they appear in the same translation unit, or</li>
<li>they both declare names with module linkage and are attached to the same module, or</li>
<li>they both declare names with external linkage.</li>
</ol>
<p>[<em>Note</em>: There are other circumstances in which declarations declare the same entity ([dcl.link], [temp.type], [temp.class.spec]). — <em>end note</em>]</p>
</blockquote>
<blockquote>
<p>If a declaration <em>H</em> that declares a name with internal linkage precedes a declaration <em>D</em> in another translation unit <em>U</em> and would declare the same entity as <em>D</em> if it appeared in <em>U</em>, the program is ill-formed. [<em>Note</em>: Such an <em>H</em> can appear only in a header unit. — <em>end note</em>]</p>
</blockquote>
</div>
<p>Change paragraph 10:</p>
<blockquote>
<p>If <s>a declaration would redeclare a reachable</s><u>two</u> declaration<u>s of an entity are</u> attached to <s>a </s>different module<u>s</u>, the program is ill-formed<u>; no diagnostic is required if neither is reachable from the other</u>. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>] As a consequence of these rules, all declarations of an entity are attached to the same module; the entity is said to be <em>attached</em> to that module.</p>
</blockquote>
<p>Change paragraph 11:</p>
<blockquote>
<p><u>For any two declarations of an entity:</u></p>
<ol style="list-style-type: decimal">
<li><u>If one declares it to be a variable or function, the other shall declare it as one of the same type.</u></li>
<li><u>If one declares it to be an enumerator, the other shall do so.</u></li>
<li><u>If one declares it to be a namespace, the other shall do so.<!-- TODO: with the same inline status? --></u></li>
<li><u>If one declares it to be a type, the other shall declare it to be a type of the same kind ([dcl.type.elab]).</u></li>
<li><u>If one declares it to be a class template, the other shall do so with the same kind and an equivalent <em>template-head</em> ([temp.over.link]). [<em>Note</em>: The declarations may supply different default template arguments. — <em>end note</em>]</u></li>
<li><u>If one declares it to be a function template or a (partial specialization of a) variable template, the other shall declare it to be one with an equivalent <em>template-head</em> and type.</u></li>
<li><u>If one declares it to be an alias template, the other shall declare it to be one with an equivalent <em>template-head</em> and <em>defining-type-id</em>.</u></li>
<li><u>If one declares it to be a concept, the other shall do so.</u></li>
</ol>
<p><u>Types are compared a</u><s>A</s>fter all adjustments of types (during which typedefs ([dcl.typedef]) are replaced by their definitions)<s>, the types specified by all declarations referring to a given variable or function shall be identical, except that</s><u>;</u> declarations for an array object can specify array types that differ by the presence or absence of a major array bound ([dcl.array]). <s>A violation of this rule on type identity does not require a</s><u>No</u> diagnostic<u> is required if neither declaration is reachable from the other</u>. <u>[<em>Example</em>:</u></p>
<pre class="sourceCode cpp ins"><code class="sourceCode cpp"><span class="dt">int</span> f(<span class="dt">int</span> x,<span class="dt">int</span> x);  <span class="co">// error: different entities for x</span>
<span class="dt">void</span> g();            <span class="co">// #1</span>
<span class="dt">void</span> g(<span class="dt">int</span>);         <span class="co">// OK: different entity from #1</span>
<span class="dt">int</span> g();             <span class="co">// error: same entity as #1 with different type</span>
<span class="dt">void</span> h();            <span class="co">// #2</span>
<span class="kw">namespace</span> h {}       <span class="co">// error: same entity as #2, but not a function</span></code></pre>
<p><u>— <em>end example</em>]</u></p>
</blockquote>
<h3 id="basic.life">#[basic.life]</h3>
<p>Change the footnote in paragraph 6:</p>
<blockquote>
<p>For example, before the <s>construction of a global object that is initialized via a user-provided constructor</s><u>dynamic initialization of an object with static storage duration</u> ([<s>class.cdtor</s><u>basic.start.dynamic</u>]).</p>
</blockquote>
<h3 id="basic.stc">#[basic.stc]</h3>
<h4 id="basic.stc.static">#[basic.stc.static]</h4>
<p>Change paragraph 3:</p>
<blockquote>
<p>The keyword <code>static</code> can be used to declare a <s>local</s><u>block</u> variable with static storage duration. [<em>Note</em>: [stmt.dcl]<u> and [basic.start.term]</u> describe<s>s</s> the initialization <s>of local <code>static</code> variables; [basic.start.term] describes the</s><u>and</u> destruction of <s>local <code>static</code></s><u>such</u> variables. — <em>end note</em>]</p>
</blockquote>
<h4 id="basic.stc.auto">#[basic.stc.auto]</h4>
<p>Change paragraph 1:</p>
<blockquote>
<p><s>Block-scope v</s><u>V</u>ariables<u> that belong to a block or parameter scope and are</u> not explicitly declared <code>static</code>, <code>thread_local</code>, or <code>extern</code> have <em>automatic storage duration</em>. The storage for these entities lasts until the block in which they are created exits.</p>
</blockquote>
<h4 id="basic.stc.dynamic">#[basic.stc.dynamic]</h4>
<h5 id="basic.stc.dynamic.allocation">#[basic.stc.dynamic.allocation]</h5>
<p>Change paragraph 1:</p>
<blockquote>
<p>An allocation function <s>shall be</s><u>that is not</u> a class member function <s>or a global function; a program is ill-formed if an allocation function is declared in a namespace scope other than</s><u>shall belong to the</u> global scope <s>or declared static in global scope</s><u>and not have a name with internal linkage</u>. The return type shall be <code>void*</code>. The first parameter shall have type <code>std::size_t</code> ([support.types]). The first parameter shall not have an associated default argument ([dcl.fct.default]). The value of the first parameter is interpreted as the requested size of the allocation. An allocation function can be a function template. Such a template shall declare its return type and first parameter as specified above (that is, template parameter types shall not be used in the return type and first parameter type). <s>Template a</s><u>A</u>llocation function<u> template</u>s shall have two or more parameters.</p>
</blockquote>
<h5 id="basic.stc.dynamic.deallocation">#[basic.stc.dynamic.deallocation]</h5>
<p>Change paragraph 1:</p>
<blockquote>
<p><u>A d</u><s>D</s>eallocation function<s>s shall be</s><u> that is not a</u> class member function<s>s or global functions; a program is ill-formed if deallocation functions are declared in a namespace scope other than</s><u> shall belong to the</u> global scope<s> or declared static in global scope</s><u> and not have a name with internal linkage</u>.</p>
</blockquote>
<h3 id="basic.type.qualifier">#[basic.type.qualifier]</h3>
<p>Change paragraph 4:</p>
<blockquote>
<p>[<em>Note</em>: See [dcl.fct] and [<s>class.this</s><u>over.match.funcs</u>] regarding function types that have <em>cv-qualifier</em>⁠s. — <em>end note</em>]</p>
</blockquote>
<h3 id="basic.start">#[basic.start]</h3>
<h4 id="basic.start.main">#[basic.start.main]</h4>
<p>Change paragraph 1:</p>
<blockquote>
<p>A program shall contain <s>a global</s><u>exactly one</u> function called <code>main</code> <s>attached</s><u>that belongs</u> to the global <s>module</s><u>scope</u>. Executing a program starts a main thread of execution ([intro.multithread], [thread.threads]) in which the <code>main</code> function is invoked, and in which variables of static storage duration might be initialized ([basic.start.static]) and destroyed ([basic.start.term]). It is implementation-defined whether a program in a freestanding environment is required to define a <code>main</code> function. [<em>Note</em>: In a freestanding environment, startup and termination is implementation-defined; startup contains the execution of constructors for <u>non-local </u>objects<s> of namespace scope</s> with static storage duration; termination contains the execution of destructors for objects with static storage duration. — <em>end note</em>]</p>
</blockquote>
<p>Change paragraph 2:</p>
<blockquote>
<p>An implementation shall not predefine the <code>main</code> function. <s>This function shall not be overloaded.</s> Its type shall have C++ language linkage and it shall have a declared return type of type <code>int</code>, but otherwise its type is implementation-defined. […]</p>
</blockquote>
<p>Change paragraph 3:</p>
<blockquote>
<p>The function <code>main</code> shall not be used within a program. The linkage ([basic.link]) of <code>main</code> is implementation-defined. A program that defines <code>main</code> as deleted or that declares <code>main</code> to be <code>inline</code>, <code>static</code>, or <code>constexpr</code> is ill-formed. The function <code>main</code> shall not be a coroutine ([dcl.fct.def.coroutine]). The <code>main</code> function shall not be declared with a <em>linkage-specification</em> ([dcl.link]). A program that declares a variable <code>main</code> <s>at</s><u>that belongs to the</u> global scope, or that declares a function <code>main</code> <s>at</s><u>that belongs to the</u> global scope <u>and is </u>attached to a named module, or that declares <s>the</s><u>an entity</u> name<u>d</u> <code>main</code> with C language linkage (in any namespace) is ill-formed. The name <code>main</code> is not otherwise reserved. [<em>Example</em>: Member functions, classes, and enumerations can be called <code>main</code>, as can entities in other namespaces. — <em>end example</em>]</p>
</blockquote>
<h4 id="basic.start.static">#[basic.start.static]</h4>
<p>Change paragraph 2:</p>
<blockquote>
<p>[…][<em>Note</em>: The dynamic initialization of non-<s>local</s><u>block</u> variables is described in [basic.start.dynamic]; that of <s>local </s>static <u>block </u>variables is described in [stmt.dcl]. — <em>end note</em>]</p>
</blockquote>
<p>Change the note in paragraph 3:</p>
<blockquote>
<p>As a consequence, if the initialization of an object <code>obj1</code> refers to an object <code>obj2</code><s> of namespace scope</s> potentially requiring dynamic initialization and defined later in the same translation unit, it is unspecified whether the value of <code>obj2</code> used will be the value of the fully initialized <code>obj2</code> (because <code>obj2</code> was statically initialized) or will be the value of <code>obj2</code> merely zero-initialized. […]</p>
</blockquote>
<h4 id="dynamic-initialization-of-non-localblock-variables-basic.start.dynamic">Dynamic initialization of non-<s>local</s><u>block</u> variables #[basic.start.dynamic]</h4>
<p>Replace all occurrences of “non-local variable” with “non-block variable” (including in the name of the subclause).</p>
<h4 id="basic.start.term">#[basic.start.term]</h4>
<p>Change paragraph 3:</p>
<blockquote>
<p>[…] If an object is initialized statically, the object is destroyed in the same order as if the object was dynamically initialized. For an object of array or class type, all subobjects of that object are destroyed before any block<s>-scope object</s><u> variable</u> with static storage duration initialized during the construction of the subobjects is destroyed. If the destruction of an object with static or thread storage duration exits via an exception, the function <code>std::terminate</code> is called ([except.terminate]).</p>
</blockquote>
<p>Change paragraph 4:</p>
<blockquote>
<p>If a function contains a block<s>-scope object</s><u> variable</u> of static or thread storage duration that has been destroyed and the function is called during the destruction of an object with static or thread storage duration, the program has undefined behavior if the flow of control passes through the definition of the previously destroyed block<s>-scope object</s><u> variable</u>. <u>[<em>Note</em>: </u>Likewise, the behavior is undefined if the block<s>-scope object</s><u> variable</u> is used indirectly (<s>i.e.</s><u><em>e.g.</em></u>, through a pointer) after its destruction.<u> — <em>end note</em>]</u></p>
</blockquote>
<h2 id="expr">#[expr]</h2>
<h3 id="expr.prim">#[expr.prim]</h3>
<h4 id="expr.prim.this">#[expr.prim.this]</h4>
<p>Change paragraph 1:</p>
<blockquote>
<p>The keyword <code>this</code> names a pointer to the object for which a non-static member function ([class.<s>this</s><u>mfct.non-static</u>]) is invoked or a non-static data member’s initializer ([class.mem]) is evaluated.</p>
</blockquote>
<p>Insert before paragraph 2:</p>
<div class="ins">
<blockquote>
<p>The <em>current class</em> at a program point is the class associated with the innermost class scope containing that point. [<em>Note</em>: A <em>lambda-expression</em> does not introduce a class scope. — <em>end note</em>]</p>
</blockquote>
</div>
<p>Change paragraph 2:</p>
<blockquote>
<p>If a declaration declares a member function or member function template of a class <code>X</code>, the expression <code>this</code> is a prvalue of type “pointer to <em>cv-qualifier-seq</em> <code>X</code>”<u> wherever <code>X</code> is the current class</u> between the optional <em>cv-qualifier-seq</em> and the end of the <em>function-definition</em>, <em>member-declarator</em>, or <em>declarator</em>. It<s> shall not appear before the optional <em>cv-qualifier-seq</em> and it</s> shall not appear within the declaration of a static member function<u> of the current class</u> (although its type and value category are defined within a static member function as they are within a non-static member function). [<em>Note</em>: This is because declaration matching does not occur until the complete declarator is known. — <em>end note</em>] [<em>Note</em>: In a <em>trailing-return-type</em>, the class being defined is not required to be complete for purposes of class member access ([expr.ref]). Class members declared later are not visible. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>] — <em>end note</em>]</p>
</blockquote>
<p>Change paragraph 3:</p>
<blockquote>
<p>Otherwise, if a <em>member-declarator</em> declares a non-static data member ([class.mem]) of a class <code>X</code>, the expression <code>this</code> is a prvalue of type “pointer to <code>X</code>”<u> wherever <code>X</code> is the current class</u> within the optional default member initializer ([class.mem]). <s>It shall not appear elsewhere in the <em>member-declarator</em>.</s></p>
</blockquote>
<h4 id="expr.prim.id">#[expr.prim.id]</h4>
<p>Insert before paragraph 2:</p>
<div class="ins">
<blockquote>
<p>If an <em>id-expression</em> <em>E</em> denotes a member <em>M</em> of an anonymous union ([class.union.anon]) <em>U</em>:</p>
<ol style="list-style-type: decimal">
<li>If <em>U</em> is a non-static data member, <em>E</em> refers to <em>M</em> as a member of the lookup context of the terminal name of <em>E</em> (after any transformation to a class member access expression ([class.mfct.non-static])). [<em>Example</em>: <code>o.x</code> is interpreted as <code>o.<em>u</em>.x</code>, where <em><code>u</code></em> names the anonymous union member. — <em>end example</em>]</li>
<li>Otherwise, <em>E</em> is interpreted as a class member access ([expr.ref]) that designates the member subobject <em>M</em> of the anonymous union variable for <em>U</em>. [<em>Note</em>: Under this interpretation, <em>E</em> no longer denotes a non-static data member. — <em>end note</em>][<em>Example</em>: <code>N::x</code> is interpreted as <code>N::<em>u</em>.x</code>, where <em><code>u</code></em> names the anonymous union variable. — <em>end example</em>]</li>
</ol>
</blockquote>
</div>
<h5 id="expr.prim.id.unqual">#[expr.prim.id.unqual]</h5>
<p>Insert before paragraph 2:</p>
<div class="ins">
<blockquote>
<p>A <em>component name</em> of an <em>unqualified-id</em> <em>U</em> is <em>U</em> if it is a name or the component name of the <em>template-id</em> or <em>type-name</em> of <em>U</em>, if any. [<em>Note</em>: Other constructs that contain names to look up can have several component names ([expr.prim.id.qual], [dcl.type.simple], [dcl.type.elab], [dcl.mptr], [namespace.udecl], [temp.param], [temp.names], [temp.res]). — <em>end note</em>] The <em>terminal name</em> of a construct is the component name of that construct that appears lexically last.</p>
</blockquote>
</div>
<p>Change paragraph 2:</p>
<blockquote>
<p>The result is the entity denoted by the <s>identifier</s><u><em>unqualified-id</em> ([basic.lookup.unqual])</u>. If the entity is a local entity […]</p>
</blockquote>
<h5 id="expr.prim.id.qual">#[expr.prim.id.qual]</h5>
<p>Insert before paragraph 1:</p>
<div class="ins">
<blockquote>
<p>The component names of a <em>qualified-id</em> are those of its <em>nested-name-specifier</em> and <em>unqualified-id</em>. The component names of a <em>nested-name-specifier</em> are its <em>identifier</em> (if any) and those of its <em>type-name</em>, <em>namespace-name</em>, <em>simple-template-id</em>, and/or <em>nested-name-specifier</em>.</p>
</blockquote>
<blockquote>
<p>A <em>nested-name-specifier</em> is <em>declarative</em> if it is part of</p>
<ol style="list-style-type: decimal">
<li>a <em>class-head-name</em>,</li>
<li>an <em>enum-head-name</em>,</li>
<li>a <em>qualified-id</em> that is the <em>id-expression</em> of a <em>declarator-id</em>, or</li>
<li>a declarative <em>nested-name-specifier</em>.</li>
</ol>
<p>A declarative <em>nested-name-specifier</em> shall not have a <em>decltype-specifier</em>. A declaration that uses a declarative <em>nested-name-specifier</em> shall be a friend declaration or inhabit a scope that contains the entity being redeclared or specialized.</p>
</blockquote>
</div>
<p>Change paragraph 1:</p>
<blockquote>
<p><u>The <em>nested-name-specifier</em> <code>::</code> nominates the global namespace.</u> <s>The type denoted by</s><u>A <em>nested-name-specifier</em> with</u> a <em>decltype-specifier</em> <s>in a <em>nested-name-specifier</em></s><u>nominates the type denoted by the <em>decltype-specifier</em>, which</u> shall be a class or enumeration type. <u>If a <em>nested-name-specifier</em> <em>N</em> is declarative and has a <em>simple-template-id</em> with a template argument list <em>A</em> that involves a template parameter, let <em>T</em> be the template nominated by <em>N</em> without <em>A</em>. <em>T</em> shall be a class template.</u></p>
<ol style="list-style-type: decimal">
<li><u>If <em>A</em> is the template argument list ([temp.arg]) of the corresponding <em>template-head</em> <em>H</em> ([temp.mem]), <em>N</em> nominates the primary template of <em>T</em>; <em>H</em> shall be equivalent to the <em>template-head</em> of <em>T</em> ([temp.over.link]).</u></li>
<li><u>Otherwise, <em>N</em> nominates the partial specialization ([temp.class.spec]) of <em>T</em> whose template argument list is equivalent to <em>A</em> ([temp.over.link]); the program is ill-formed if no such partial specialization exists.</u></li>
</ol>
<p><u>Any other <em>nested-name-specifier</em> nominates the entity denoted by its <em>type-name</em>, <em>namespace-name</em>, <em>identifier</em>, or <em>simple-template-id</em>. If the <em>nested-name-specifier</em> is not declarative, the entity shall not be a template.</u></p>
</blockquote>
<p>Insert before paragraph 2:</p>
<div class="ins">
<blockquote>
<p>A <em>qualified-id</em> shall not be of the form <em>nested-name-specifier</em> <code>template</code><sub><em>opt</em></sub> <code>~</code> <em>decltype-specifier</em> nor of the form <em>decltype-specifier</em> <code>::</code> <code>~</code> <em>type-name</em>.</p>
</blockquote>
</div>
<p>Change paragraph 2:</p>
<blockquote>
<p><s>A <em>nested-name-specifier</em> that denotes a class, optionally followed by the keyword <code>template</code> ([temp.names]), and then followed by the name of a member of either that class ([class.mem]) or one of its base classes ([class.derived]), is a <em>qualified-id</em>; [class.qual] describes name lookup for class members that appear in <em>qualified-id</em>⁠s.</s> The result<u> of a <em>qualified-id</em></u> is the <s>member</s><u>entity it denotes ([basic.lookup.qual])</u>. The type of the <s>result</s><u>expression</u> is the type of the <s>member</s><u>result</u>. The result is an lvalue if the member is<u> a function, a variable, a structured binding ([dcl.struct.bind]),</u> a static member function<u>,</u> or a data member and a prvalue otherwise. <s>[<em>Note</em>: A class member can be referred to using a <em>qualified-id</em> at any point in its potential scope ([basic.scope.class]). — <em>end note</em>] Where <em>type-name</em> <code>::~</code> <em>type-name</em> is used, the two <em>type-name</em>⁠s shall refer to the same type (ignoring cv-qualifications); this notation denotes the destructor of the type so named ([expr.prim.id.dtor]). The <em>unqualified-id</em> in a <em>qualified-id</em> shall not be of the form <code>~</code><em>decltype-specifier</em>.</s></p>
</blockquote>
<p>Remove paragraphs 3 through 5:</p>
<div class="del">
<blockquote>
<p>The <em>nested-name-specifier</em> <code>::</code> names the global namespace. […]</p>
</blockquote>
<blockquote>
<p>A <em>nested-name-specifier</em> that denotes an enumeration ([dcl.enum]), followed by the name of an enumerator of that enumeration, […]</p>
</blockquote>
<blockquote>
<p>In a <em>qualified-id</em>, if the <em>unqualified-id</em> is a <em>conversion-function-id</em>, […]</p>
</blockquote>
</div>
<h4 id="expr.prim.lambda">#[expr.prim.lambda]</h4>
<h5 id="expr.prim.lambda.closure">#[expr.prim.lambda.closure]</h5>
<p>Change paragraph 4:</p>
<blockquote>
<p>[…] <s>[<em>Note</em>: Names referenced in the <em>lambda-declarator</em> are looked up in the context in which the <em>lambda-expression</em> appears. — <em>end note</em>]</s> [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 12:</p>
<blockquote>
<p>The <em>lambda-expression</em>’s <em>compound-statement</em> yields the <em>function-body</em> ([dcl.fct.def]) of the function call operator, but <s>for purposes of name lookup ([basic.lookup]), determining the type and value of <code>this</code> ([class.this]) and transforming <em>id-expression</em>⁠s referring to non-static class members into class member access expressions using <code>(*this)</code> ([class.mfct.non-static]), the <em>compound-statement</em> is considered in the context of the <em>lambda-expression</em></s><u>it is not within the scope of the closure type</u>.<!-- remote --> [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>] Further, a variable <code>__func__</code> is implicitly defined at the beginning of the <em>compound-statement</em> of the <em>lambda-expression</em>, with semantics as described in [dcl.fct.def.general].</p>
</blockquote>
<h5 id="expr.prim.lambda.capture">#[expr.prim.lambda.capture]</h5>
<p>Change paragraph 4:</p>
<blockquote>
<p>The <em>identifier</em> in a <em>simple-capture</em> <s>is looked up using the usual rules for unqualified name lookup ([basic.lookup.unqual]); each such lookup </s>shall <s>find</s><u>denote a</u> a local entity<u> ([basic.lookup.unqual])</u>. The <em>simple-capture</em>⁠s <code>this</code> and <code>* this</code> denote the local entity <code>*this</code>. An entity that is designated by a <em>simple-capture</em> is said to be <em>explicitly captured</em>.</p>
</blockquote>
<p>Change paragraph 6:</p>
<blockquote>
<p><u>An <em>init-capture</em> inhabits the scope of the <em>lambda-expression</em>’s <em>compound-statement</em>.</u> An <em>init-capture</em> without ellipsis behaves as if it declares and explicitly captures a variable of the form “<code>auto</code> <em>init-capture</em> <code>;</code>”<s> whose declarative region is the <em>lambda-expression</em>’s <em>compound-statement</em></s>, except that:</p>
<p>[…]</p>
</blockquote>
<p>Change paragraph 8:</p>
<blockquote>
<p>An entity is <em>captured</em> if it is captured explicitly or implicitly. An entity captured by a <em>lambda-expression</em> is odr-used ([basic.def.odr]) <s>in the scope containing</s><u>by</u> the <em>lambda-expression</em>. […]</p>
</blockquote>
<p>Change paragraph 17:</p>
<blockquote>
<p>A <em>simple-capture</em> containing an ellipsis is a pack expansion ([temp.variadic]). An <em>init-capture</em> containing an ellipsis is a pack expansion that <s>introduces</s><u>declares</u> an <em>init-capture</em> pack ([temp.variadic])<s> whose declarative region is the <em>lambda-expression</em>’s <em>compound-statement</em></s>. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<h4 id="expr.prim.req">#[expr.prim.req]</h4>
<p>Change the grammar in paragraph 1:</p>
<blockquote>
<p>[…]</p>
<p><em>requirement-parameter-list</em>:</p>
<blockquote>
<p><code>(</code> <em>parameter-declaration-clause</em><sub><s><em>opt</em></s></sub> <code>)</code></p>
</blockquote>
<p>[…]</p>
</blockquote>
<p>Change paragraph 4:</p>
<blockquote>
<p>A <em>requires-expression</em> may introduce local parameters using a <em>parameter-declaration-clause</em> ([dcl.fct]). A local parameter of a <em>requires-expression</em> shall not have a default argument. <s>Each name introduced by a local parameter is in scope from the point of its declaration until the closing brace of the <em>requirement-body</em>.</s> These parameters have no linkage, storage, or lifetime; they are only used as notation for the purpose of defining <em>requirement</em>s. […]</p>
</blockquote>
<p>Remove paragraph 5:</p>
<div class="del">
<blockquote>
<p>The <em>requirement-body</em> contains a sequence of <em>requirement</em>s. […]</p>
</blockquote>
</div>
<h3 id="expr.post">#[expr.post]</h3>
<h4 id="expr.call">#[expr.call]</h4>
<p>Change paragraph 7:</p>
<blockquote>
<p>[…] If the function is a non-static member function, the <code>this</code> parameter of the function ([<s>class</s><u>expr.prim</u>.this]) is initialized with a pointer to the object of the call, converted as if by an explicit type conversion ([expr.cast]). […][<em>Example</em>: The access of the constructor, conversion functions or destructor is checked at the point of call in the calling function. If a constructor or destructor for a function parameter throws an exception, the search for a handler starts in <s>the scope of </s>the calling function; in particular, if the function called has a <em>function-try-block</em> ([except.pre]) with a handler that could handle the exception, this handler is not considered. — <em>end example</em>]</p>
</blockquote>
<h4 id="expr.ref">#[expr.ref]</h4>
<p>Change paragraph 1:</p>
<blockquote>
<p>A postfix expression followed by a dot <code>.</code> or an arrow <code>-&gt;</code>, optionally followed by the keyword <code>template</code><s> ([temp.names])</s>, and then followed by an <em>id-expression</em>, is a postfix expression. The postfix expression before the dot or arrow is evaluated;<sup>[…]</sup> the result of that evaluation, together with the <em>id-expression</em>, determines the result of the entire postfix expression. <u>[<em>Note</em>: If the keyword <code>template</code> is used, the following unqualified name is considered to refer to a template ([temp.names]). If a <em>simple-template-id</em> results and is followed by a <code>::</code>, the <em>id-expression</em> is a <em>qualified-id</em>. — <em>end note</em>]</u></p>
</blockquote>
<p>Change paragraph 4:</p>
<blockquote>
<p>Otherwise, the object expression shall be of class type. The class type shall be complete unless the class member access appears in the definition of that class. [<em>Note</em>: <s>If the class is incomplete, lookup in</s><u>The program is ill-formed if the result differs from that when</u> the<u> class is</u> complete<s> class type is required to refer to the same declaration</s> ([<s>basic.scope.</s>class<u>.member.lookup</u>]). — <em>end note</em>] <s>The <em>id-expression</em> shall name a member of the class or of one of its base classes. [<em>Note</em>: Because the name of a class is inserted in its class scope ([class]), the name of a class is also considered a nested member of that class. — <em>end note</em>]</s> [<em>Note</em>: [basic.lookup.<s>classref</s><u>qual</u>] describes how names are looked up after the <code>.</code> and <code>-&gt;</code> operators. — <em>end note</em>]</p>
</blockquote>
<p>Change bullet (6.3):</p>
<blockquote>
<p>If <code>E2</code> is <s>a (possibly overloaded) member function</s><u>an overload set</u>, function overload resolution ([over.match]) is used to select the function to which <code>E2</code> refers. The type of <code>E1.E2</code> is the type of <code>E2</code> and <code>E1.E2</code> refers to the function referred to by <code>E2</code>.</p>
</blockquote>
<h3 id="expr.unary">#[expr.unary]</h3>
<h4 id="expr.unary.op">#[expr.unary.op]</h4>
<p>Change paragraph 6:</p>
<blockquote>
<p>[<em>Note</em>: The address of an overload<s>ed function</s><u>set</u> ([over]) can be taken only in a context that uniquely determines which <s>version of the overloaded </s>function is referred to (see [over.over]). Since the context might determine whether the operand is a static or non-static member function, the context can also affect whether the expression has type “pointer to function” or “pointer to member function”. — <em>end note</em>]</p>
</blockquote>
<h4 id="expr.await">#[expr.await]</h4>
<p>Change paragraph 2:</p>
<blockquote>
<p>[…] An <em>await-expression</em> shall not appear in the initializer of a block<s>-scope</s> variable with static or thread storage duration. A context within a function where an <em>await-expression</em> can appear is called a <em>suspension context</em> of the function.</p>
</blockquote>
<p>Change bullet (3.2):</p>
<blockquote>
<p><s><em>a</em> is the <em>cast-expression</em> if</s><u>Unless</u> the <em>await-expression</em> was implicitly produced by a <em>yield-expression</em> ([expr.yield]), an initial suspend point, or a final suspend point ([dcl.fct.def.coroutine])<s>. Otherwise</s>, <u>a search is performed for </u>the <s><em>unqualified-id</em></s><u>name</u> <code>await_transform</code> <s>is looked up with</s>in the scope of <code>P</code><s> by class member access lookup</s> ([<s>basic.</s><u>class.member.</u>lookup<s>.classref</s>])<s>, and i</s><u>. I</u>f this <s>lookup</s><u>search is performed and</u> finds at least one declaration, then <em>a</em> is <em>p</em><code>.await_transform(</code><em>cast-expression</em><code>)</code>; otherwise, <em>a</em> is the <em>cast-expression</em>.</p>
</blockquote>
<h4 id="expr.new">#[expr.new]</h4>
<p>Change paragraph 11:</p>
<blockquote>
<p>If the <em>new-expression</em> <u>does not </u>begin<s>s</s> with a unary <code>::</code> operator<s>, the allocation function’s name is looked up in the global scope. Otherwise, if</s><u> and</u> the allocated type is a class type <code>T</code> or array thereof, <u>a search is performed for </u>the allocation function’s name <s>is looked up </s>in the scope of <code>T</code><u> ([class.member.lookup])</u>. <s>If this lookup fails to find the name, or if the allocated type is not a class type</s><u>Otherwise, or if nothing is found</u>, the allocation function’s name is looked up<u> by searching for it</u> in the global scope.</p>
</blockquote>
<p>Change paragraph 24:</p>
<blockquote>
<p>If the <em>new-expression</em> creates an object or an array of objects of class type, access and ambiguity control are done for the allocation function, the deallocation function ([<s>class.free</s><u>basic.stc.dynamic.deallocation</u>]), and the constructor ([class.ctor]) selected for the initialization (if any). If the <em>new-expression</em> creates an array of objects of class type, the destructor is potentially invoked ([class.dtor]).</p>
</blockquote>
<p>Change paragraph 26:</p>
<blockquote>
<p>If the <em>new-expression</em> <u>does not </u>begin<s>s</s> with a unary <code>::</code> operator<s>, the deallocation function’s name is looked up in the global scope. Otherwise, if</s><u> and</u> the allocated type is a class type <code>T</code> or an array thereof, <u>a search is performed for </u>the deallocation function’s name <s>is looked up </s>in the scope of <code>T</code>. <s>If this lookup fails to find the name, or if the allocated type is not a class type or array thereof</s><u>Otherwise, or if nothing is found</u>, the deallocation function’s name is looked up<u> by searching for it</u> in the global scope.</p>
</blockquote>
<h4 id="expr.delete">#[expr.delete]</h4>
<p>Change paragraph 8:</p>
<blockquote>
<p><u>If a deallocation function is called, it is <code>operator delete</code> for a single-object delete expression or <code>operator delete[]</code> for an array delete expression.</u> [<em>Note</em>: An implementation provides default definitions of the global deallocation functions<s> <code>operator delete</code> for non-arrays</s> ([new.delete.single]<s>) and <code>operator delete[]</code> for arrays (</s><u>, </u>[new.delete.array]). A C++ program can provide alternative definitions of these functions ([replacement.functions]), and/or class-specific versions ([class.free]). — <em>end note</em>]</p>
</blockquote>
<p>Change paragraph 9 (incorporating some of [class.free]/4):</p>
<blockquote>
<p><s>When</s><u>If</u> the keyword <code>delete</code> in a <em>delete-expression</em> is<u> not</u> preceded by the unary <code>::</code> operator<s>, the deallocation function’s name is looked up in global scope. Otherwise, the lookup considers class-specific deallocation functions ([class.free]).</s><u> and the type of the operand is a pointer to a (possibly cv-qualified) class type <code>T</code>:</u></p>
<ol style="list-style-type: decimal">
<li><u>If <code>T</code> has a virtual destructor, the deallocation function is the one selected at the point of definition of the dynamic type’s virtual destructor ([class.dtor]).</u></li>
<li><u>Otherwise, a search is performed for the deallocation function’s name in the scope of <code>T</code>.</u></li>
</ol>
<p><s>If no class-specific deallocation function</s><u>Otherwise, or if nothing</u> is found, the deallocation function’s name is looked up <u>by searching for it </u>in <u>the </u>global scope. <u>In any case, any declarations other than of usual deallocation functions ([basic.stc.dynamic.deallocation]) are discarded.<!-- remote --> [<em>Note</em>: If only a placement deallocation function is found in a class, the program is ill-formed because the lookup set is empty ([basic.lookup]). — <em>end note</em>]</u></p>
</blockquote>
<p>Change paragraph 10:</p>
<blockquote>
<p>If <s>deallocation function lookup finds </s>more than one <s>usual </s>deallocation function<u> is found</u>, the function to be called is selected as follows:</p>
<ol style="list-style-type: decimal">
<li>If any of the deallocation functions is a destroying operator delete, all deallocation functions that are not destroying operator deletes are eliminated from further consideration.</li>
<li>If the type has new-extended alignment, a function with a parameter of type <code>std::align_val_t</code> is preferred; otherwise a function without such a parameter is preferred. If any preferred functions are found, all non-preferred functions are eliminated from further consideration.</li>
<li>If exactly one function remains, that function is selected and the selection process terminates.</li>
<li>If the deallocation functions <s>have</s><u>belong to a</u> class scope, the one without a parameter of type <code>std::size_t</code> is selected.</li>
<li>If the type is complete and if, for an array delete expression only, the operand is a pointer to a class type with a non-trivial destructor or a (possibly multi-dimensional) array thereof, the function with a parameter of type <code>std::size_t</code> is selected.</li>
<li>Otherwise, it is unspecified whether a deallocation function with a parameter of type <code>std::size_t</code> is selected.</li>
</ol>
</blockquote>
<h3 id="expr.const">#[expr.const]</h3>
<p>Change paragraph 13:</p>
<blockquote>
<p>An expression or conversion is in an <em>immediate function context</em> if it is potentially evaluated and its innermost <u>enclosing </u>non-block scope is a function parameter scope of an immediate function. An expression or conversion is an <em>immediate invocation</em> if it is an explicit or implicit invocation of an immediate function and is not in an immediate function context. An immediate invocation shall be a constant expression.</p>
</blockquote>
<p>Change bullet (15.7):</p>
<blockquote>
<p>a variable <s>whose name appears as</s><u>named by</u> a potentially constant evaluated expression that is either a constexpr variable or is of non-volatile const-qualified integral type or of reference type.</p>
</blockquote>
<h2 id="stmt.stmt">#[stmt.stmt]</h2>
<h3 id="stmt.pre">#[stmt.pre]</h3>
<p>Remove paragraph 5:</p>
<div class="del">
<blockquote>
<p>[<em>Note</em>: A name introduced in a <em>selection-statement</em> or <em>iteration-statement</em> outside of any substatement is in scope […] — <em>end note</em>]</p>
</blockquote>
</div>
<p>Change paragraph 7:</p>
<blockquote>
<p>If a <em>condition</em> can be syntactically resolved as either an expression or <s>the</s><u>a</u> declaration<s> of a block-scope name</s>, it is interpreted as <s>a declaration</s><u>the latter</u>.</p>
</blockquote>
<h3 id="stmt.label">#[stmt.label]</h3>
<p>Change paragraph 1:</p>
<blockquote>
<p>[…]</p>
<p>The optional <em>attribute-specifier-seq</em> appertains to the label. <s>An <em>identifier label</em> declares the identifier.</s> The only use of a<s>n identifier</s> label<u> with an <em>identifier</em></u> is as the target of a <code>goto</code>. <s>The scope of a label is the function in which it appears. L</s><u>No two l</u>abels <s>shall not be redeclared with</s>in a function<u> shall have the same <em>identifier</em></u>. A label can be used in a <code>goto</code> statement before its <s>declaration</s><u>introduction by a <em>labeled-statement</em></u>. <s>Labels have their own name space and do not interfere with other identifiers. [<em>Note</em>: A label may have the same name as another declaration in the same scope or a <em>template-parameter</em> from an enclosing scope. Unqualified name lookup ([basic.lookup.unqual]) ignores labels. — <em>end note</em>]</s></p>
</blockquote>
<h3 id="stmt.block">#[stmt.block]</h3>
<p>Change paragraph 1:</p>
<blockquote>
<p>[…]</p>
<p><u>[<em>Note</em>: </u>A compound statement defines a block scope ([basic.scope]). <s>[<em>Note</em>: </s>A declaration is a <em>statement</em> ([stmt.dcl]). — _end note_]</p>
</blockquote>
<h3 id="stmt.select">#[stmt.select]</h3>
<p>Change paragraph 2:</p>
<blockquote>
<p><s>The substatement in a</s><u>[<em>Note</em>: Each</u> <em>selection-statement</em> <s>(</s><u>and </u>each substatement<s>, in the <code>else</code> form of the <code>if</code> statement</s><u> of a <em>selection-statement</em></u><s>)</s> <s>implicitly defines</s><u>has</u> a block scope ([basic.scope<u>.block</u>]).<u> — <em>end note</em>]</u> <s>If the substatement in a <em>selection-statement</em> is a single statement and not a <em>compound-statement</em>, it is as if it was rewritten to be a <em>compound-statement</em> containing the original substatement. [<em>Example</em>:</s></p>
<p><s>[…]</s></p>
<p><s>can be equivalently rewritten as</s></p>
<p><s>[…]</s></p>
<p><s>Thus after the <code>if</code> statement, <code>i</code> is no longer in scope. — <em>end example</em>]</s></p>
</blockquote>
<h4 id="stmt.if">#[stmt.if]</h4>
<p>Change paragraph 3:</p>
<blockquote>
<p>[…]</p>
<p>except that <s>names declared in </s>the <em>init-statement</em> <s>are</s><u>is</u> in the same <s>declarative region</s><u>scope</u> as <s>those declared in </s>the <em>condition</em>.</p>
</blockquote>
<h4 id="stmt.switch">#[stmt.switch]</h4>
<p>Change paragraph 7 as for [stmt.if]/3.</p>
<h3 id="stmt.iter">#[stmt.iter]</h3>
<p>Remove paragraph 3:</p>
<div class="del">
<blockquote>
<p>If a name introduced in an <em>init-statement</em> or <em>for-range-declaration</em> is redeclared […]</p>
</blockquote>
</div>
<h4 id="stmt.while">#[stmt.while]</h4>
<p>Change paragraph 2:</p>
<blockquote>
<p><s>When the condition of a <code>while</code> statement is a declaration, the scope of the variable that is declared extends from its point of declaration ([basic.scope.pdecl]) to the end of the <code>while</code> <em>statement</em>.</s> A <code>while</code> statement is equivalent to</p>
<p>[…]</p>
<p>[<em>Note</em>: The variable created in the condition is destroyed and created with each iteration of the loop. [<em>Example</em>:</p>
<p>[…]</p>
<p>In the while-loop, the constructor and destructor are each called twice, once for the condition that succeeds and once for the condition that fails. — <em>end example</em>] — <em>end note</em>]</p>
</blockquote>
<h4 id="stmt.for">#[stmt.for]</h4>
<p>Change paragraph 1 as for [stmt.if]/3 (up to a comma instead of a period).</p>
<p>Remove paragraph 3 (whose example is moved to [basic.scope.block]):</p>
<div class="del">
<blockquote>
<p>If the <em>init-statement</em> is a declaration, […]</p>
</blockquote>
</div>
<h4 id="stmt.ranged">#[stmt.ranged]</h4>
<p>Change bullet (1.3.2):</p>
<blockquote>
<p>if the <em>for-range-initializer</em> is an expression of class type <code>C</code><s>, the <em>unqualified-id</em>⁠s</s><u> and searches in the scope of <code>C</code> ([class.member.lookup]) for the names</u> <code>begin</code> and <code>end</code> <s>are looked up in the scope of <code>C</code> as if by class member access lookup ([basic.lookup.classref]), and if both</s><u>each</u> find at least one declaration, <em>begin-expr</em> and <em>end-expr</em> are <em><code>range</code></em><code>.begin()</code> and <em><code>range</code></em><code>.end()</code>, respectively;</p>
</blockquote>
<p>Change bullet (1.3.3):</p>
<blockquote>
<p>otherwise, <em>begin-expr</em> and <em>end-expr</em> are <code>begin(<em>range</em>)</code> and <code>end(<em>range</em>)</code>, respectively, where <code>begin</code> and <code>end</code> <s>are</s><u>undergo argument-dependent</u> look<s>ed </s>up<s> in the associated namespaces</s> ([basic.lookup.argdep]). [<em>Note</em>: Ordinary unqualified lookup ([basic.lookup.unqual]) is not performed. — <em>end note</em>]</p>
</blockquote>
<h3 id="stmt.jump">#[stmt.jump]</h3>
<p>Change paragraph 2:</p>
<blockquote>
<p><u>[<em>Note</em>: </u>On exit from a scope (however accomplished), objects with automatic storage duration ([basic.stc.auto]) that have been constructed in that scope are destroyed in the reverse order of their construction. <s>[<em>Note</em>: </s>For temporaries, see [class.temporary].<s> — <em>end note</em>] Transfer out of a loop, out of a block, or back past an initialized variable with automatic storage duration involves the destruction of objects with automatic storage duration that are in scope at the point transferred from but not at the point transferred to. (See [stmt.dcl] for transfers into blocks). [<em>Note</em>: </s>However, the program can be terminated (by calling <code>std::exit()</code> or <code>std::abort()</code> ([support.start.term]), for example) without destroying objects with automatic storage duration. — <em>end note</em>][<em>Note</em>: A suspension of a coroutine ([expr.await]) is not considered to be an exit from a scope. — <em>end note</em>]</p>
</blockquote>
<h3 id="stmt.dcl">#[stmt.dcl]</h3>
<p>Change paragraph 1:</p>
<blockquote>
<p>A declaration statement introduces one or more new <s>identifiers</s><u>names</u> into a block; it has the form</p>
<blockquote>
<p><em>declaration-statement</em>:</p>
<blockquote>
<p><em>block-declaration</em></p>
</blockquote>
</blockquote>
<p><u>[<em>Note</em>: </u>If an identifier introduced by a declaration was previously declared in an outer block, the outer declaration is hidden for the remainder of the block<u> ([basic.lookup.unqual])</u>, after which it resumes its force.<u> — <em>end note</em>]</u></p>
</blockquote>
<p>Change paragraph 2:</p>
<blockquote>
<p><u>A v</u><s>V</s>ariable<s>s</s> with automatic storage duration ([basic.stc.auto]) <u>is <em>active</em> everywhere in the scope to which it belongs after its <em>init-declarator</em></u><s>are initialized each time their <em>declaration-statement</em> is executed</s>. <s>Variables with automatic storage duration declared in the block are destroyed on exit from the block ([stmt.jump]).</s></p>
</blockquote>
<p>Change paragraph 3:</p>
<blockquote>
<p><s>It is possible to transfer into a block, but not in a way that bypasses declarations with initialization (including ones in <em>condition</em>s and <em>init-statement</em>s). A program that</s><u>Upon each transfer of control (including sequential execution of statements) within a function from point <em>P</em> to point <em>Q</em>, all variables that are active at <em>P</em> and not at <em>Q</em> are destroyed in the reverse order of their construction. Then, all variables that are active at <em>Q</em> but not at <em>P</em> are initialized in declaration order; unless all such variables have vacuous initialization ([basic.life]), the transfer of control shall not be a</u> jump<s>s</s><sup>[…]</sup><s> from a point where a variable with automatic storage duration is not in scope to a point where it is in scope is ill-formed unless the variable has vacuous initialization ([basic.life])</s>. <s>In such a case, the variables with vacuous initialization are constructed in the order of their declaration.</s> <u>When a <em>declaration-statement</em> is executed, <em>P</em> and <em>Q</em> are the points immediately before and after it; when a function returns, <em>Q</em> is after its body.</u> [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 4:</p>
<blockquote>
<p>Dynamic initialization of a block<s>-scope</s> variable with static storage duration ([basic.stc.static]) or thread storage duration ([basic.stc.thread]) is performed the first time control passes through its declaration; such a variable is considered initialized upon the completion of its initialization. […]</p>
</blockquote>
<p>Change paragraph 5:</p>
<blockquote>
<p>A<u>n</u><s> block-scope</s> object <u>associated with a block variable </u>with static or thread storage duration will be destroyed if and only if it was constructed. [<em>Note</em>: [basic.start.term] describes the order in which <s>block-scope</s><u>such</u> objects<s> with static and thread storage duration</s> are destroyed. — <em>end note</em>]</p>
</blockquote>
<h3 id="stmt.ambig">#[stmt.ambig]</h3>
<p>Change paragraph 3:</p>
<blockquote>
<p>[…] Disambiguation precedes parsing, and a statement disambiguated as a declaration may be an ill-formed declaration. If, during parsing, <u>lookup finds that </u>a name in a template <s>parameter is bound differently than it would be bound during a trial parse</s><u>argument is bound to (part of) the declaration being parsed</u>, the program is ill-formed. No diagnostic is required. <s>[<em>Note</em>: This can occur only when the name is declared earlier in the declaration. — <em>end note</em>]</s> [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<h2 id="dcl.dcl">#[dcl.dcl]</h2>
<h3 id="dcl.pre">#[dcl.pre]</h3>
<p>Change paragraph 4:</p>
<blockquote>
<p><s>A declaration occurs in a scope ([basic.scope]); the scope rules are summarized in [basic.lookup]. A</s><u>Certain</u> declaration<u>s</u> <s>that declares a function or defines a class, namespace, template, or function also has</s><u>contain</u> one or more scopes<s> nested within it</s><u> ([basic.scope.scope])</u>. <s>These nested scopes, in turn, can have declarations nested within them.</s> Unless otherwise stated, utterances in [dcl.dcl] about components in, of, or contained by a declaration or subcomponent thereof refer only to those components of the declaration that are <em>not</em> nested within scopes nested within the declaration.</p>
</blockquote>
<p>Change paragraph 5:</p>
<blockquote>
<p>In a <em>simple-declaration</em>, the optional <em>init-declarator-list</em> can be omitted only when declaring a class ([class<u>.pre</u>]) or enumeration ([dcl.enum]), that is, when the <em>decl-specifier-seq</em> contains either a <em>class-specifier</em>, an <em>elaborated-type-specifier</em> with a <em>class-key</em> ([class.name]), or an <em>enum-specifier</em>. In these cases and whenever a <em>class-specifier</em> or <em>enum-specifier</em> is present in the <em>decl-specifier-seq</em>, the identifiers in these specifiers are <s>among the names being</s><u>also</u> declared<s> by the declaration</s> (as <em>class-name</em>⁠s, <em>enum-name</em>⁠s, or <em>enumerator</em>⁠s, depending on the syntax). In such cases, the <em>decl-specifier-seq</em> shall <u>(re)</u>introduce one or more names into the program<s>, or shall redeclare a name introduced by a previous declaration</s>. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 9:</p>
<blockquote>
<p><s>Each <em>init-declarator</em> in the <em>init-declarator-list</em> contains exactly one <em>declarator-id</em>, which is the</s><u>If a <em>declarator-id</em> is a</u> name<u>, the</u> <s>declared by that </s><em>init-declarator</em> and <u>(</u>hence<u>)</u> <s>one of the names declared by </s>the declaration<u> introduce that name</u>. <u>[<em>Note</em>: Otherwise, the <em>declarator-id</em> is a <em>qualified-id</em> or names a destructor or its <em>unqualified-id</em> is a <em>template-id</em> and no name is introduced. — <em>end note</em>]</u> The <em>defining-type-specifier</em>⁠s ([dcl.type]) in the <em>decl-specifier-seq</em> and the recursive <em>declarator</em> structure<s> of the <em>init-declarator</em></s> describe a type ([dcl.meaning]), which is then associated with the <s>name being declared by the <em>init-declarator</em></s><u><em>declarator-id</em></u>.</p>
</blockquote>
<p>Change paragraph 10:</p>
<blockquote>
<p>If the <em>decl-specifier-seq</em> contains the <code>typedef</code> specifier, the declaration is called a <em>typedef declaration</em><u>, each <em>declarator-id</em> must be an <em>identifier</em></u> and <s>the name of each <em>init-declarator</em> </s>is declared to be a <em>typedef-name</em>, synonymous with its associated type ([dcl.typedef]). If the <em>decl-specifier-seq</em> contains no <code>typedef</code> specifier, the declaration is called a <em>function declaration</em> if the type associated with <s>the name</s><u>a <em>declarator-id</em></u> is a function type ([dcl.fct]) and an <em>object declaration</em> otherwise.</p>
</blockquote>
<h3 id="dcl.spec">#[dcl.spec]</h3>
<h4 id="dcl.stc">#[dcl.stc]</h4>
<p>Change paragraph 1:</p>
<blockquote>
<p>[…] If a <em>storage-class-specifier</em> appears in a <em>decl-specifier-seq</em>, there can be no <code>typedef</code> specifier in the same <em>decl-specifier-seq</em> and the <em>init-declarator-list</em> or <em>member-declarator-list</em> of the declaration shall not be empty (except for an anonymous union declared in a <s>named </s>namespace <s>or in the global namespace, which shall be declared <code>static</code></s><u>scope</u> ([class.union.anon])). The <em>storage-class-specifier</em> applies to the name declared by each <em>init-declarator</em> in the list and not to any names declared by other specifiers. [<em>Note</em>: See [temp.expl.spec] and [temp.explicit] for restrictions in explicit specializations and explicit instantiations, respectively. — <em>end note</em>]</p>
</blockquote>
<p>Change paragraph 6:</p>
<blockquote>
<p><s>The linkages implied by successive</s><u>All</u> declarations for a given entity shall <s>agree</s><u>give its name the same linkage</u>. <s>That is, within a given scope, each declaration declaring the same variable name or the same overloading of a function name shall imply the same linkage.</s> <u>[<em>Note</em>: The linkage given by some declarations is affected by previous declarations. Overloads are distinct entities. — <em>end note</em>]</u> [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<h4 id="dcl.typedef">#[dcl.typedef]</h4>
<p>Change paragraph 2:</p>
<blockquote>
<p>A <em>typedef-name</em> can also be introduced by an <em>alias-declaration</em>. The <em>identifier</em> following the <code>using</code> keyword<u> is not looked up; it</u> becomes a <em>typedef-name</em> and the optional <em>attribute-specifier-seq</em> following the <em>identifier</em> appertains to that <em>typedef-name</em>. […]</p>
</blockquote>
<p>Remove paragraphs 3 through 7:</p>
<div class="del">
<blockquote>
<p>In a given non-class scope, a <code>typedef</code> specifier can be used to redeclare […]</p>
</blockquote>
<blockquote>
<p>In a given class scope, a <code>typedef</code> specifier can be used to redeclare […]</p>
</blockquote>
<blockquote>
<p>If a <code>typedef</code> specifier is used to redeclare […]</p>
</blockquote>
<blockquote>
<p>In a given scope, a <code>typedef</code> specifier shall not be used to redeclare […]</p>
</blockquote>
<blockquote>
<p>Similarly, in a given scope, a class or enumeration shall not be declared […]</p>
</blockquote>
</div>
<h4 id="dcl.inline">#[dcl.inline]</h4>
<p>Change paragraph 6:</p>
<blockquote>
<p>[<em>Note</em>: An inline function or variable with external or module linkage <s>has the same address</s><u>can be defined</u> in <s>all</s><u>multiple</u> translation units<u> ([basic.def.odr]), but is one entity with one address</u>. A <u>type or </u><code>static</code> <s>local </s>variable<u> defined</u> in <s>an inline</s><u>the body of such a</u> function <s>with external or module linkage always refers to the same object</s><u>is therefore a single entity</u>. <s>A type defined within the body of an inline function with external or module linkage is the same type in every translation unit.</s> — <em>end note</em>]</p>
</blockquote>
<h4 id="dcl.type">#[dcl.type]</h4>
<h5 id="dcl.type.simple">#[dcl.type.simple]</h5>
<p>Insert before paragraph 2:</p>
<div class="ins">
<blockquote>
<p>The component names of a <em>simple-type-specifier</em> are those of its <em>nested-name-specifier</em>, <em>type-name</em>, <em>simple-template-id</em>, <em>template-name</em>, and/or <em>type-constraint</em> (if it is a <em>placeholder-type-specifier</em>). The component name of a <em>type-name</em> is the first name in it.</p>
</blockquote>
</div>
<h5 id="dcl.type.elab">#[dcl.type.elab]</h5>
<p>Insert before paragraph 1:</p>
<div class="ins">
<blockquote>
<p>The component names of an <em>elaborated-type-specifier</em> are its <em>identifier</em> (if any) and those of its <em>nested-name-specifier</em> and <em>simple-template-id</em> (if any).</p>
</blockquote>
</div>
<p>Change paragraph 1:</p>
<blockquote>
<p><s>An <em>attribute-specifier-seq</em> shall not appear in an <em>elaborated-type-specifier</em> unless the latter is the sole constituent of a declaration.</s> If an <em>elaborated-type-specifier</em> is the sole constituent of a declaration, the declaration is ill-formed unless it is an explicit specialization ([temp.expl.spec]), an explicit instantiation ([temp.explicit]) or it has one of the following forms:</p>
<blockquote>
<p><em>class-key</em> <em>attribute-specifier-seq</em><sub><em>opt</em></sub> <em>identifier</em> <code>;</code><br /><u><em>class-key</em> <em>attribute-specifier-seq</em><sub><em>opt</em></sub> <em>simple-template-id</em> <code>;</code></u><br /><s><code>friend</code> <em>class-key</em> <code>::</code><sub><em>opt</em></sub> <em>identifier</em> <code>;</code><br /><code>friend</code> <em>class-key</em> <code>::</code><sub><em>opt</em></sub> <em>simple-template-id</em> <code>;</code><br /><code>friend</code> <em>class-key</em> <em>nested-name-specifier</em> <em>identifier</em> <code>;</code><br /><code>friend</code> <em>class-key</em> <em>nested-name-specifier</em> <code>template</code><sub><em>opt</em></sub> <em>simple-template-id</em> <code>;</code></s></p>
</blockquote>
<p>In the first case, <u>it declares the <em>identifier</em> as a <em>class-name</em>. The second case shall appear only in an <em>explicit-specialization</em> ([temp.expl.spec]) or in a <em>template-declaration</em> (where it declares a partial specialization ([temp.decls])). T</u><s>t</s>he <em>attribute-specifier-seq</em>, if any, appertains to the class<u> or template</u> being declared<s>; the attributes in the <em>attribute-specifier-seq</em> are thereafter considered attributes of the class whenever it is named</s>.</p>
</blockquote>
<p>Insert before paragraph 2:</p>
<div class="ins">
<blockquote>
<p>Otherwise, the <em>elaborated-type-specifier</em> shall not have an <em>attribute-specifier-seq</em>. If it contains a <em>identifier</em> but no <em>nested-name-specifier</em> and (unqualified) lookup for the <em>identifier</em> finds nothing, it shall not be introduced by the <code>enum</code> keyword and declares the <em>identifier</em> as a <em>class-name</em>. Its target scope is the nearest enclosing namespace or block scope.</p>
</blockquote>
<blockquote>
<p>If it appears with the <code>friend</code> specifier as an entire declaration, the declaration shall have one of the following forms:</p>
<blockquote>
<p><code>friend</code> <em>class-key</em> <em>nested-name-specifier</em><sub><em>opt</em></sub> <em>identifier</em> <code>;</code><br /><code>friend</code> <em>class-key</em> <em>simple-template-id</em> <code>;</code><br /><code>friend</code> <em>class-key</em> <em>nested-name-specifier</em> <code>template</code><sub><em>opt</em></sub> <em>simple-template-id</em> <code>;</code></p>
</blockquote>
<p>Any unqualified lookup for the <em>identifier</em> (in the first case) does not consider scopes that contain the target scope; no name is bound.<!-- remote --> [<em>Note</em>: A <em>using-directive</em> in the target scope is ignored if it refers to a namespace not contained by that scope. [basic.lookup.elab] describes how name lookup proceeds in an <em>elaborated-type-specifier</em>. — <em>end note</em>]</p>
</blockquote>
</div>
<p>Change paragraph 2:</p>
<blockquote>
<p>[<em>Note</em>: <s>[basic.lookup.elab] describes how name lookup proceeds for the <em>identifier</em> in a</s><u>A</u>n <em>elaborated-type-specifier</em><u> may be used to refer to a previously declared <em>class-name</em> or <em>enum-name</em> even if the name has been hidden by a non-type declaration</u>. — <em>end note</em>] If the <em>identifier</em> or <em>simple-template-id</em> resolves to a <em>class-name</em> or <em>enum-name</em>, the <em>elaborated-type-specifier</em> introduces it into the declaration the same way a <em>simple-type-specifier</em> introduces its <em>type-name</em> ([dcl.type.simple]). […]</p>
</blockquote>
<h5 id="dcl.type.decltype">#[dcl.type.decltype]</h5>
<p>Change bullet (1.3):</p>
<blockquote>
<p>otherwise, if <code>e</code> is an unparenthesized <em>id-expression</em> or an unparenthesized class member access ([expr.ref]), <code>decltype(e)</code> is the type of the entity named by <code>e</code>. If there is no such entity<s>, or if <code>e</code> names a set of overloaded functions</s>, the program is ill-formed;</p>
</blockquote>
<h5 id="dcl.spec.auto">#[dcl.spec.auto]</h5>
<p>Change paragraph 11:</p>
<blockquote>
<p>If <s>the name of</s> a<s>n entity</s><u> variable or function</u> with an undeduced placeholder type <s>appears in</s><u>is named by</u> an expression<u> ([basic.def.odr])</u>, the program is ill-formed. Once a non-discarded <code>return</code> statement has been seen in a function, however, the return type deduced from that statement can be used in the rest of the function, including in other <code>return</code> statements. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 13:</p>
<blockquote>
<u>If a function or function template has a declared return type that uses a placeholder type, r</u><s>R</s>edeclarations or specializations<u> (respectively)</u> of <s>a function or function template with a declared return type that uses a placeholder type</s><u>it</u> shall <s>also </s>use that placeholder, not a deduced type<s>. Similarly, redeclarations or specializations of a function or function template with a declared return type that does not use a placeholder type</s><u>; otherwise, they</u> shall not use a placeholder.
<pre class="cpp">
[&hellip;]
int f();                                        // error: <s>cannot be overloaded with </s>auto <s>f()</s><u>and int don't match</u>
[&hellip;]
</pre>

</blockquote>
<h3 id="dcl.decl">#[dcl.decl]</h3>
<p>Change paragraph 1:</p>
<blockquote>
<p>A declarator declares a single variable, function, or type, within a declaration. The <em>init-declarator-list</em> appearing in a <s>declaration</s><u><em>simple-declaration</em></u> is a comma-separated sequence of declarators, each of which can have an initializer.</p>
<p>[…]</p>
</blockquote>
<p>Change paragraph 2:</p>
<blockquote>
<p><s>The three components of a <em>simple-declaration</em> are the attributes ([dcl.attr]), the specifiers (<em>decl-specifier-seq</em>; [dcl.spec]) and the declarators (<em>init-declarator-list</em>).</s> <u>In all contexts, a <em>declarator</em> is interpreted as given below. Where an <em>abstract-declarator</em> can be used (or omitted) in place of a <em>declarator</em> ([dcl.fct], [except.pre]), it is as if a unique identifier were included in the appropriate place ([dcl.name])</u>. The <u>preceding </u>specifiers indicate the type, storage class or other properties of the <u>entity or </u>entities being declared. <s>The</s><u>Each</u> declarator<s>s</s> specif<s>y</s><u>ies</u> <s>the names of these</s><u>one</u> entit<s>ies</s><u>y</u> and (optionally) <u>names it and/or </u>modif<s>y</s><u>ies</u> the type of the specifiers with operators such as <code>*</code> (pointer to) and <code>()</code> (function returning). <s>Initial values</s><u>[<em>Note</em>: An <em>init-declarator</em> </u> can also <s>be </s>specif<s>ied in a declarator;</s><u>y an</u> initializer<s>s are discussed in</s> <u>(</u>[dcl.init]<s> and [class.init]</s><u>)</u>.<u> — <em>end note</em>]</u></p>
</blockquote>
<p>Change paragraph 3:</p>
<blockquote>
<p>Each <em>init-declarator</em><u> or <em>member-declarator</em></u> in a declaration is analyzed separately as if it <s>was</s><u>were</u> in a declaration by itself. [<em>Note</em>: A declaration with several declarators is usually equivalent to the corresponding sequence of declarations each with a single declarator. That is<u>,</u></p>
<pre class="sourceCode cpp"><code class="sourceCode cpp">T D1, D2, ... Dn;</code></pre>
<p>is usually equivalent to</p>
<pre class="sourceCode cpp"><code class="sourceCode cpp">T D1; T D2; ... T Dn;</code></pre>
<p>where <code>T</code> is a <em>decl-specifier-seq</em> and each <code>Di</code> is an <em>init-declarator</em><u> or <em>member-declarator</em></u>. […]</p>
<p>— <em>end note</em>]</p>
</blockquote>
<h4 id="dcl.meaning">#[dcl.meaning]</h4>
<p>Change paragraph 1:</p>
<blockquote>
<p>A declarator contains exactly one <em>declarator-id</em>; it names the <s>identifier</s><u>entity</u> that is declared. <s>An</s><u>If the</u> <em>unqualified-id</em> occurring in a <em>declarator-id</em> <s>shall be</s><u>is</u> a <s>simple <em>identifier</em> except for the declaration of some special</s><u><em>template-id</em>, the declarator shall appear in the <em>declaration</em> of a <em>template-declaration</em> ([temp.decls]), <em>explicit-specialization</em> ([temp.expl.spec]), or <em>explicit-instantiation</em> ([temp.explicit]). [<em>Note</em>: An <em>unqualified-id</em> that is not an <em>identifier</em> is used to declare certain</u> functions (<s>[class.ctor], </s>[class.conv<u>.fct</u>], [class.dtor], [over.oper]<u>, [over.literal]</u>)<s> and for the declaration of template specializations or partial specializations ([temp.spec])</s>.<u> — <em>end note</em>]</u> <s>When the <em>declarator-id</em> is qualified, the declaration shall refer to a previously declared member of the class or namespace to which the qualifier refers (or, in the case of a namespace, of an element of the inline namespace set of that namespace ([namespace.def])) or to a specialization thereof; the member shall not merely have been introduced by a <em>using-declaration</em> in the scope of the class or namespace nominated by the <em>nested-name-specifier</em> of the <em>declarator-id</em>. The <em>nested-name-specifier</em> of a qualified <em>declarator-id</em> shall not begin with a <em>decltype-specifier</em>. [<em>Note</em>: If the qualifier is the global <code>::</code> scope resolution operator, the <em>declarator-id</em> refers to a name declared in the global namespace scope. — <em>end note</em>]</s> The optional <em>attribute-specifier-seq</em> following a <em>declarator-id</em> appertains to the entity that is declared.</p>
</blockquote>
<p>Insert before paragraph 2, including the examples from [namespace.memdef]/2 and from [basic.link]/7, with changes as marked for the latter:</p>
<div class="ins">
<blockquote>
<p>If the declaration is a friend declaration:</p>
<ol style="list-style-type: decimal">
<li>The <em>declarator</em> binds no name.</li>
<li>If the <em>id-expression</em> <em>E</em> in a <em>declarator-id</em> is a <em>qualified-id</em> or a <em>template-id</em>:
<ol style="list-style-type: decimal">
<li>If the friend declaration is not a template declaration, then in the lookup for the terminal name of <em>E</em>:
<ol style="list-style-type: decimal">
<li>if the <em>unqualified-id</em> in <em>E</em> is a <em>template-id</em>, all function declarations are discarded;</li>
<li>otherwise, if the <em>declarator</em> corresponds ([basic.scope.scope]) to any declaration found of a non-template function, all function template declarations are discarded;</li>
<li>each remaining function template is replaced with the specialization chosen by deduction from the friend declaration ([temp.deduct.decl]) or discarded if deduction fails.</li>
</ol></li>
<li>The <em>declarator</em> shall correspond to one or more declarations found by the lookup; they shall all have the same target scope, and the target scope of the <em>declarator</em> is that scope.</li>
</ol></li>
<li>Otherwise, the terminal name of <em>E</em> is not looked up. The declaration’s target scope is the innermost enclosing namespace scope; if the declaration is contained by a block scope, it shall correspond to a declaration that inhabits the innermost block scope.</li>
</ol>
</blockquote>
<blockquote>
<p>Otherwise:</p>
<ol style="list-style-type: decimal">
<li>If the <em>id-expression</em> in a <em>declarator-id</em> is a <em>qualified-id</em> <em>Q</em>, let <em>S</em> be its lookup context ([basic.lookup.qual]); the declaration shall inhabit a namespace scope.</li>
<li>Otherwise, let <em>S</em> be the entity associated with the scope inhabited by the <em>declarator</em>.</li>
<li><p>If the <em>declarator</em> declares an explicit instantiation or a partial or explicit specialization, the <em>declarator</em> binds no name. If it declares a class member, the terminal name of the <em>declarator-id</em> is not looked up; otherwise, only those lookup results that are nominable in <em>S</em> are considered when identifying any function template specialization being declared ([temp.deduct.decl]). [<em>Example</em>:</p>
<pre class="sourceCode cpp"><code class="sourceCode cpp"><span class="kw">namespace</span> N {
  <span class="kw">inline</span> <span class="kw">namespace</span> O {
    <span class="kw">template</span>&lt;<span class="kw">class</span> T&gt; <span class="dt">void</span> f(T);   <span class="co">// #1</span>
    <span class="kw">template</span>&lt;<span class="kw">class</span> T&gt; <span class="dt">void</span> g(T) {}
  }
  <span class="kw">namespace</span> P {
    <span class="kw">template</span>&lt;<span class="kw">class</span> T&gt; <span class="dt">void</span> f(T*);  <span class="co">// #2, more specialized than #1</span>
    <span class="kw">template</span>&lt;<span class="kw">class</span>&gt; <span class="dt">int</span> g;
  }
  <span class="kw">using</span> P::f,P::g;
}
<span class="kw">template</span>&lt;&gt; <span class="dt">void</span> N::f(<span class="dt">int</span>*) {}      <span class="co">// OK: #2 is not nominable</span>
<span class="kw">template</span> <span class="dt">void</span> N::g(<span class="dt">int</span>);           <span class="co">// error: lookup is ambiguous</span></code></pre>
— <em>end example</em>]</li>
<li><p>Otherwise, the terminal name of the <em>declarator-id</em> is not looked up. If it is a qualified name, the <em>declarator</em> shall correspond to one or more declarations nominable in <em>S</em>; all the declarations shall have the same target scope and the target scope of the <em>declarator</em> is that scope. <span class="mv">[<em>Example</em>:</span></p>
<p><span class="mv">[… from [namespace.memdef]/2]</span></p>
<span class="mv">— <em>end example</em>]</span></li>
<li><p>If the declaration inhabits a block scope <em>S</em> and declares a function ([dcl.fct]) or uses the <code>extern</code> specifier, the declaration shall not be attached to a named module ([module.unit]); its target scope is the innermost enclosing namespace scope, but the name is bound in <em>S</em>. <span class="mv">[<em>Example</em>:</span><!-- FIXME: the <pre> shouldn't be outside the list --></p></li>
</ol>
<pre class="cpp mv">
namespace X {
  void p() {
    q();                        // error: q not yet declared
    extern void q();            // q is a member of namespace X<u>
    extern void r();            // r is a member of namespace X</u>
  }

  void middle() {
    q();                        // error: q not <s>yet declared</s><u>found</u>
  }

  void q() { /* ... */ }        // definition of X::q
}

void q() { /* ... */ }          // some other, unrelated q<u>
void X::r() { /* ... */ } // error: r cannot be declared by qualified-id</u>
</pre>
<p><span class="mv">— <em>end example</em>]</span></p>
</blockquote>
</div>
<p>[<em>Drafting note</em>: Richard proposed making the restriction on use of a <em>qualified-id</em> grammatical. — <em>end drafting note</em>]</p>
<p>Change paragraph 2:</p>
<blockquote>
<p>A <code>static</code>, <code>thread_local</code>, <code>extern</code>, <code>mutable</code>, <code>friend</code>, <code>inline</code>, <code>virtual</code>, <code>constexpr</code>, or <code>typedef</code> specifier or an <em>explicit-specifier</em> applies directly to each <em>declarator-id</em> in a<s>n <em>init-declarator-list</em> or <em>member-declarator-list</em></s><u> declaration</u>; the type specified for each <em>declarator-id</em> depends on both the <em>decl-specifier-seq</em> and its <em>declarator</em>.</p>
</blockquote>
<p>Change paragraph 3:</p>
<blockquote>
<p>Thus, <u>(for each <em>declarator</em>) </u>a declaration<s> of a particular identifier</s> has the form</p>
<pre class="sourceCode cpp"><code class="sourceCode cpp">T D</code></pre>
<p>where <code>T</code> is of the form <em>attribute-specifier-seq</em><sub><em>opt</em></sub> <em>decl-specifier-seq</em> and <code>D</code> is a declarator. Following is a recursive procedure for determining the type specified for the contained <em>declarator-id</em> by such a declaration.</p>
</blockquote>
<p>Change paragraph 5:</p>
<blockquote>
<p>In a declaration <em>attribute-specifier-seq</em><sub><em>opt</em></sub> <code>T</code> <code>D</code> where <code>D</code> is an unadorned <s>identifier</s><u>name</u> the type of <s>this identifier</s><u>the declared entity</u> is “<code>T</code>”.</p>
</blockquote>
<h5 id="dcl.ptr">#[dcl.ptr]</h5>
<p>Change paragraph 1:</p>
<blockquote>
<p>In a declaration <code>T</code> <code>D</code> where <code>D</code> has the form</p>
<blockquote>
<p><code>*</code> <em>attribute-specifier-seq</em><sub><em>opt</em></sub> <em>cv-qualifier-seq</em><sub><em>opt</em></sub> <code>D1</code></p>
</blockquote>
<p>and the type of the <s>identifier</s><u>contained <em>declarator-id</em></u> in the declaration <code>T</code> <code>D1</code> is “<em>derived-declarator-type-list</em> <code>T</code>”, <s>then </s>the type of the <s>identifier of</s><u><em>declarator-id</em> in</u> <code>D</code> is “<em>derived-declarator-type-list</em> <em>cv-qualifier-seq</em> pointer to <code>T</code>”. […]</p>
</blockquote>
<h5 id="dcl.ref">#[dcl.ref]</h5>
<p>Change paragraph 1:</p>
<blockquote>
<p>In a declaration <code>T</code> <code>D</code> where <code>D</code> has either of the forms</p>
<blockquote>
<p><code>&amp;</code> <em>attribute-specifier-seq</em><sub><em>opt</em></sub> <code>D1</code><br /><code>&amp;&amp;</code> <em>attribute-specifier-seq</em><sub><em>opt</em></sub> <code>D1</code></p>
</blockquote>
<p>and the type of the <s>identifier</s><u>contained <em>declarator-id</em></u> in the declaration <code>T</code> <code>D1</code> is “<em>derived-declarator-type-list</em> <code>T</code>”, <s>then </s>the type of the <s>identifier of</s><u><em>declarator-id</em> in</u> <code>D</code> is “<em>derived-declarator-type-list</em> reference to <code>T</code>”. […]</p>
</blockquote>
<h5 id="dcl.mptr">#[dcl.mptr]</h5>
<p>Prepend paragraph:</p>
<div class="ins">
<blockquote>
<p>The component names of a <em>ptr-operator</em> are those of its <em>nested-name-specifier</em>, if any.</p>
</blockquote>
</div>
<p>Change paragraph 1:</p>
<blockquote>
<p>In a declaration <code>T</code> <code>D</code> where <code>D</code> has the form</p>
<blockquote>
<p><em>nested-name-specifier</em> <code>*</code> <em>attribute-specifier-seq</em><sub><em>opt</em></sub> <em>cv-qualifier-seq</em><sub><em>opt</em></sub> <code>D1</code></p>
</blockquote>
<p>and the <em>nested-name-specifier</em> denotes a class, and the type of the <s>identifier</s><u>contained <em>declarator-id</em></u> in the declaration <code>T</code> <code>D1</code> is “<em>derived-declarator-type-list</em> <code>T</code>”, <s>then </s>the type of the <s>identifier of</s><u><em>declarator-id</em> in</u> <code>D</code> is “<em>derived-declarator-type-list</em> <em>cv-qualifier-seq</em> pointer to member of class <em>nested-name-specifier</em> of type <code>T</code>”. […]</p>
</blockquote>
<h5 id="dcl.array">#[dcl.array]</h5>
<p>Change paragraph 8:</p>
<blockquote>
<p>Furthermore, if there is a <s>preceding</s><u>reachable</u> declaration of the entity <s>in</s><u>that inhabits</u> the same scope in which the bound was specified, an omitted array bound is taken to be the same as in that earlier declaration, and similarly for the definition of a static data member of a class. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<h5 id="dcl.fct">#[dcl.fct]</h5>
<p>Change paragraph 5, appending an example adapted from [over.load]/3:</p>
<blockquote>
<p>The type of a function is determined using the following rules. The type of each parameter (including function parameter packs) is determined from its own <s><em>decl-specifier-seq</em> and <em>declarator</em></s><u><em>parameter-declaration</em> ([dcl.decl])</u>. […][<em>Note</em>: This transformation does not affect the types of the parameters. For example, <code>int(*)(const int p, decltype(p)*)</code> and <code>int(*)(int, const int*)</code> are identical types. — <em>end note</em>] <u>[<em>Example</em>:</u></p>
<pre class="sourceCode cpp ins"><code class="sourceCode cpp"><span class="dt">void</span> f(<span class="dt">char</span>*);             <span class="co">// #1</span>
<span class="dt">void</span> f(<span class="dt">char</span>[]) {}          <span class="co">// defines #1</span>
<span class="dt">void</span> f(<span class="dt">const</span> <span class="dt">char</span>*) {}     <span class="co">// OK: another overload</span>
<span class="dt">void</span> f(<span class="dt">char</span> *<span class="dt">const</span>) {}     <span class="co">// error: redefines #1</span>

<span class="dt">void</span> g(<span class="dt">char</span>(*)[<span class="dv">2</span>]);        <span class="co">// #2</span>
<span class="dt">void</span> g(<span class="dt">char</span>[<span class="dv">3</span>][<span class="dv">2</span>]) {}      <span class="co">// defines #2</span>
<span class="dt">void</span> g(<span class="dt">char</span>[<span class="dv">3</span>][<span class="dv">3</span>]) {}      <span class="co">// OK: another overload</span>

<span class="dt">void</span> h(<span class="dt">int</span> x(<span class="dt">const</span> <span class="dt">int</span>));  <span class="co">// #3</span>
<span class="dt">void</span> h(<span class="dt">int</span> (*)(<span class="dt">int</span>)) {}    <span class="co">// defines #3</span></code></pre>
<p><u>— <em>end example</em>]</u></p>
</blockquote>
<p>Change paragraph 10:</p>
<blockquote>
<p><u>[<em>Note</em>: </u>A single name can be used for several different functions in a single scope; this is function overloading ([over]).<u> — <em>end note</em>]</u> <s>All declarations for a function shall have equivalent return types, parameter-type-lists, and <em>requires-clause</em>⁠s ([temp.over.link]).</s></p>
</blockquote>
<p>Change paragraph 15:</p>
<blockquote>
<p>An identifier can optionally be provided as a parameter name; if present in a function definition ([dcl.fct.def]), it names a parameter. [<em>Note</em>: In particular, parameter names are also optional in function definitions and names used for a parameter in different declarations and the definition of a function need not be the same. <s>If a parameter name is present in a function declaration that is not a definition, it cannot be used outside of its function declarator because that is the extent of its potential scope ([basic.scope.param]).</s> — <em>end note</em>]</p>
</blockquote>
<h5 id="dcl.fct.default">#[dcl.fct.default]</h5>
<p>Change paragraph 4:</p>
<blockquote>
<p>For non-template functions, default arguments can be added in later declarations of a function <s>in</s><u>that inhabit</u> the same scope. Declarations <s>in</s><u>that inhabit</u> different scopes have completely distinct sets of default arguments. That is, declarations in inner scopes do not acquire default arguments from declarations in outer scopes, and vice versa. […] For a given inline function defined in different translation units, the accumulated sets of default arguments at the end of the translation units shall be the same; no diagnostic is required. If a friend declaration<u> <em>D</em></u> specifies a default argument expression, that declaration shall be a definition and <u>there </u>shall be <s>the only</s><u>no other</u> declaration of the function or function template <s>in the translation unit</s><u>which is reachable from <em>D</em> or from which <em>D</em> is reachable</u>.</p>
</blockquote>
<p>Change paragraph 5:</p>
<blockquote>
<p>The default argument has the same semantic constraints as the initializer in a declaration of a variable of the parameter type, using the copy-initialization semantics ([dcl.init]). The names in the default argument are <s>bound</s><u>looked up</u>, and the semantic constraints are checked, at the point where the default argument appears. Name lookup and checking of semantic constraints for default arguments <s>in function templates and in member</s><u>of templated</u> functions<s> of class templates</s> are performed as described in [temp.inst]. [<em>Example</em>: In the following code, <code>g</code> will be called with the value <code>f(2)</code>:</p>
<p>[…]</p>
<p>— <em>end example</em>] [<em>Note</em>: <s>In member function declarations, names in default arguments are looked up as described in [basic.lookup.unqual].</s> <u>A default argument is a complete-class context ([class.mem]).</u> Access checking applies to names in default arguments as described in [class.access]. — <em>end note</em>]</p>
</blockquote>
<p>Change paragraph 9:</p>
<blockquote>
<p>A default argument is evaluated each time the function is called with no argument for the corresponding parameter. A parameter shall not appear as a potentially-evaluated expression in a default argument. <u>[<em>Note</em>: </u>Parameters of a function declared before a default argument are in scope and can hide namespace and class member names.<u> — <em>end note</em>]</u> [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>] A non-static member shall not appear in a default argument unless it appears as the <em>id-expression</em> of a class member access expression ([expr.ref]) or unless it is used to form a pointer to member ([expr.unary.op]). [<em>Example</em>: The declaration of <code>X::mem1()</code> in the following example is ill-formed because no object is supplied for the non-static member <code>X::a</code> used as an initializer.</p>
<p>[…]</p>
<p>The declaration of <code>X::mem2()</code> is meaningful, however, since no object is needed to access the static member <code>X::b</code>. Classes, objects, and members are described in [class.pre]. — <em>end example</em>] A default argument is not part of the type of a function. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>] When <u>an overload set contains </u>a declaration of a function <s>is introduced by way of a <em>using-declaration</em> ([namespace.udecl])</s><u>that inhabits a scope <em>S</em></u>, any default argument<s> information</s> associated with <s>the</s><u>any reachable</u> declaration <s>is made known as well</s><u>that inhabits <em>S</em> is available to the call</u>. <s>If the function is redeclared thereafter in the namespace with additional default arguments, the additional arguments are also known at any point following the redeclaration where the <em>using-declaration</em> is in scope.</s> <u>[<em>Note</em>: The candidate might have been found through a <em>using-declarator</em> from which the declaration that provides the default argument is not reachable. — <em>end note</em>]</u></p>
</blockquote>
<h3 id="dcl.init">#[dcl.init]</h3>
<p>Change paragraph 5:</p>
<blockquote>
<p>A declaration of a block<s>-scope</s> variable with <s>external or internal </s>linkage that has an <em>initializer</em> is ill-formed.</p>
</blockquote>
<p>Remove paragraph 13:</p>
<div class="del">
<blockquote>
<p>An initializer for a static member is in the scope of the member’s class. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
</div>
<p>Change paragraph 22:</p>
<blockquote>
<p>A declaration that specifies the initialization of a variable, whether from an explicit initializer or by default-initialization, is called the <em>initializing declaration</em> of that variable. [<em>Note</em>: In most cases this is the defining declaration ([basic.def]) of the variable, but the initializing declaration of a non-inline static data member ([class.static.data]) might be the declaration within the class definition and not the definition <s>at namespace scope</s><u>(if any) outside it</u>. — <em>end note</em>]</p>
</blockquote>
<h4 id="dcl.init.aggr">#[dcl.init.aggr]</h4>
<p>Change bullet (4.1):</p>
<blockquote>
<p>If the element is an anonymous union <s>object</s><u>member</u> and the initializer list is a <em>designated-initializer-list</em>, the <s>anonymous union object</s><u>element</u> is initialized by the <em>designated-initializer-list</em> <code>{</code><em>D</em><code>}</code>, where <em>D</em> is the <em>designated-initializer-clause</em> naming a member of the anonymous union <s>object</s><u>member</u>. […]</p>
</blockquote>
<h3 id="dcl.fct.def">#[dcl.fct.def]</h3>
<h4 id="dcl.fct.def.general">#[dcl.fct.def.general]</h4>
<p>Change paragraph 7:</p>
<blockquote>
<p><s>In the <em>function-body</em>, a</s><u>A</u> <em>function-local predefined variable</em> <s>denotes a block-scope object of</s><u>is a variable with</u> static storage duration that is implicitly defined <s>(see [basic.scope.block])</s><u>in a function parameter scope</u>.</p>
</blockquote>
<h4 id="dcl.fct.def.delete">#[dcl.fct.def.delete]</h4>
<p>Change paragraph 2:</p>
<blockquote>
<p>A program that refers to a deleted function implicitly or explicitly, other than to declare it, is ill-formed. [<em>Note</em>: This includes calling the function implicitly or explicitly and forming a pointer or pointer-to-member to the function. It applies even for references in expressions that are not potentially-evaluated. <s>If a function is overloaded, it is referenced</s><u>For an overload set,</u> only <s>if </s>the function <s>is </s>selected by overload resolution<u> is referenced</u>. The implicit odr-use ([basic.def.odr]) of a virtual function does not, by itself, constitute a reference. — <em>end note</em>]</p>
</blockquote>
<h4 id="dcl.fct.def.coroutine">#[dcl.fct.def.coroutine]</h4>
<p>Change paragraph 6:</p>
<blockquote>
<p><u>If searches for t</u><s>T</s>he <s><em>unqualified-id</em>s</s><u>names</u> <code>return_void</code> and <code>return_value</code><s> are looked up</s> in the scope of the promise type<s>. If both are found</s><u> each find any declarations</u>, the program is ill-formed. [<em>Note</em>: If <s>the <em>unqualified-id</em> </s><code>return_void</code> is found, flowing off the end of a coroutine is equivalent to a <code>co_return</code> with no operand. Otherwise, flowing off the end of a coroutine results in undefined behavior ([stmt.return.coroutine]). — <em>end note</em>]</p>
</blockquote>
<p>Change paragraph 9:</p>
<blockquote>
<p>An implementation may need to allocate additional storage for a coroutine. This storage is known as the <em>coroutine state</em> and is obtained by calling a non-array allocation function ([basic.stc.dynamic.allocation]). The allocation function’s name is looked up <u>by searching for it </u>in the scope of the promise type. <s>If this lookup fails, the allocation function’s name is looked up in the global scope.</s></p>
<ol style="list-style-type: decimal">
<li>If <s>the lookup finds an allocation function in the scope of the promise type</s><u>any declarations are found</u>, overload resolution is performed on a function call created by assembling an argument list. The first argument is the amount of space requested, and has type <code>std::size_t</code>. The lvalues <code>p</code><sub>1</sub> … <code>p</code><sub><em>n</em></sub> are the succeeding arguments.</li>
<li><u>Otherwise, a search is performed in the global scope.</u></li>
</ol>
<p>If no viable function is found ([over.match.viable]), overload resolution is performed again on a function call created by passing just the amount of space required as an argument of type <code>std::size_t</code>.</p>
</blockquote>
<p>Change paragraph 10:</p>
<blockquote>
<p><s>The <em>unqualified-id</em></s><u>If a search for the name</u> <code>get_return_object_on_allocation_failure</code><s> is looked up</s> in the scope of the promise type<s> by class member access lookup</s> ([<s>basic</s><u>class.member</u>.lookup<s>.classref</s>])<s>. If</s><u>finds</u> any declarations<s> are found</s>, then the result of a call to an allocation function used to obtain storage for the coroutine state is assumed to return <code>nullptr</code> if it fails to obtain storage, and if a global allocation function is selected, the <code>::operator new(size_t, nothrow_t)</code> form is used. […]</p>
</blockquote>
<p>Change paragraph 11:</p>
<blockquote>
<p>The coroutine state is destroyed when control flows off the end of the coroutine or the <code>destroy</code> member function ([coroutine.handle.resumption]) of a coroutine handle ([coroutine.handle]) that refers to the coroutine is invoked. In the latter case<s> objects with automatic storage duration that are in scope at the suspend point are destroyed in the reverse order of the construction</s><u>, control in the coroutine is considered to be transferred out of the function ([stmt.dcl])</u>. The storage for the coroutine state is released by calling a non-array deallocation function ([basic.stc.dynamic.deallocation]). If <code>destroy</code> is called for a coroutine that is not suspended, the program has undefined behavior.</p>
</blockquote>
<p>Change paragraph 12:</p>
<blockquote>
<p>The deallocation function’s name is looked up <u>by searching for it </u>in the scope of the promise type. If <s>this lookup fails</s><u>nothing is found</u>, <s>the deallocation function’s name</s><u>a search</u> is <s>looked up</s><u>performed</u> in the global scope. If <s>deallocation function lookup finds </s>both a usual deallocation function with only a pointer parameter and a usual deallocation function with both a pointer parameter and a size parameter<u> are found</u>, then the selected deallocation function shall be the one with two parameters. […]</p>
</blockquote>
<h3 id="dcl.struct.bind">#[dcl.struct.bind]</h3>
<p>Change paragraph 4:</p>
<blockquote>
<p>Otherwise, if the <em>qualified-id</em> <code>std::tuple_size&lt;E&gt;</code> names a complete class type with a member named <code>value</code>, the expression <code>std::tuple_size&lt;E&gt;::value</code> shall be a well-formed integral constant expression and the number of elements in the <em>identifier-list</em> shall be equal to the value of that expression. Let <code>i</code> be an index prvalue of type <code>std::size_t</code> corresponding to <code>v</code><sub><em>i</em></sub>. <s>The <em>unqualified-id</em></s><u>If a search for the name</u> <code>get</code><s> is looked up</s> in the scope of <code>E</code><s> by class member access lookup</s> ([<s>basic</s><u>class.member</u>.lookup<s>.classref</s>])<s>, and if that</s> finds at least one declaration that is a function template whose first template parameter is a non-type parameter, the initializer is <em><code>e</code></em><code>.get&lt;i&gt;()</code>. Otherwise, the initializer is <code>get&lt;i&gt;(</code><em><code>e</code></em><code>)</code>, where <code>get</code> <s>is</s><u>undergoes argument-dependent</u> look<s>ed </s>up<s> in the associated namespaces</s> ([basic.lookup.argdep]). In either case, <code>get&lt;i&gt;</code> is interpreted as a <em>template-id</em>. [<em>Note</em>: Ordinary unqualified lookup ([basic.lookup.unqual]) is not performed. — <em>end note</em>][…]</p>
</blockquote>
<h3 id="enum">#[enum]</h3>
<h4 id="dcl.enum">#[dcl.enum]</h4>
<p>Change paragraph 1:</p>
<blockquote>
<p>[…][<em>Note</em>: […] — <em>end note</em>] <u>The <em>identifier</em> in an <em>enum-head-name</em> is not looked up and is introduced by the <em>enum-specifier</em> or <em>opaque-enum-declaration</em>.</u> If the <em>enum-head-name</em> of an <em>opaque-enum-declaration</em> contains a <em>nested-name-specifier</em>, the declaration shall be an explicit specialization ([temp.expl.spec]).</p>
</blockquote>
<p>Change paragraph 4:</p>
<blockquote>
<p>If an <em>enum-head-name</em> contains a <em>nested-name-specifier</em>, <s>it shall not begin with a <em>decltype-specifier</em> and </s>the enclosing <em>enum-specifier</em> or <em>opaque-enum-declaration</em><u> <em>D</em></u> shall <s>refer to an enumeration that was previously declared directly</s><u>not inhabit a class scope and shall correspond to one or more declarations nominable</u> in the class<u>, class template,</u> or namespace to which the <em>nested-name-specifier</em> refers<s>, or in an element of the inline namespace set ([namespace.def]) of that namespace (i.e., neither inherited nor introduced by a <em>using-declaration</em>), and the <em>enum-specifier</em> or <em>opaque-enum-declaration</em> shall appear in a namespace enclosing the previous declaration</s><u> ([basic.scope.scope])</u>. <u>All those declarations shall have the same target scope; the target scope of <em>D</em> is that scope.</u></p>
</blockquote>
<p>Change paragraph 6:</p>
<blockquote>
<p>An enumeration whose underlying type is fixed is an incomplete type <s>from its point of declaration ([basic.scope.pdecl]) to</s><u>until</u> immediately after its <em>enum-base</em> (if any), at which point it becomes a complete type. An enumeration whose underlying type is not fixed is an incomplete type <s>from its point of declaration to immediately after</s><u>until</u> the closing <code>}</code> of its <em>enum-specifier</em>, at which point it becomes a complete type.</p>
</blockquote>
<p>Change paragraph 11:</p>
<blockquote>
<p><s>Each <em>enum-name</em> and</s><u>The name of</u> each unscoped <s><em>enumerator</em></s><u>enumerator</u> is <s>declared</s><u>also bound</u> in the scope that immediately contains the <em>enum-specifier</em>. <s>Each scoped <em>enumerator</em> is declared in the scope of the enumeration.</s> An unnamed enumeration that does not have a typedef name for linkage purposes ([dcl.typedef]) and that has a first enumerator is denoted, for linkage purposes ([basic.link]), by its underlying type and its first enumerator; such an enumeration is said to have an enumerator as a name for linkage purposes. <s>These names obey the scope rules defined for all names in [basic.scope] and [basic.lookup].</s> [<em>Note</em>: Each unnamed enumeration with no enumerators is a distinct type. — <em>end note</em>] [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>] <s>An enumerator declared in class scope can be referred to using the class member access operators (<code>::</code>, <code>.</code> (dot) and <code>-&gt;</code> (arrow)), see [expr.ref]. [<em>Example</em>:</s></p>
<p><s>[…]</s></p>
<p><s>— <em>end example</em>]</s></p>
</blockquote>
<h4 id="enum.udecl">#[enum.udecl]</h4>
<p>Change paragraph 2:</p>
<blockquote>
<p>A <em>using-enum-declaration</em> <s>introduces the enumerator names of the named enumeration as if by</s><u>is equivalent to</u> a <em>using-declaration</em> for each enumerator.</p>
</blockquote>
<p>Change paragraph 3:</p>
<blockquote>
<p>[<em>Note</em>: A <em>using-enum-declaration</em> in class scope <s>adds</s><u>makes</u> the enumerators of the named enumeration <s>as members to the scope. This means they are accessible for</s><u>available via</u> member lookup. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>] — <em>end note</em>]</p>
</blockquote>
<h3 id="basic.namespace">#[basic.namespace]</h3>
<p>Change paragraph 1:</p>
<blockquote>
<p>A namespace is an optionally-named <s>declarative region</s><u>entity whose scope can contain declarations of any kind of entity</u>. The name of a namespace can be used to access entities <s>declared in</s><u>that belong to</u> that namespace; that is, the <s>members</s><u><em>members</em></u> of the namespace. Unlike other <s>declarative regions</s><u>entities</u>, the definition of a namespace can be split over several parts of one or more translation units<u> and modules</u>.</p>
</blockquote>
<p>Change paragraph 2:</p>
<blockquote>
<p>[<em>Note</em>: A <s>namespace name with external linkage</s><u><em>namespace-definition</em></u> is exported <s>if any of its <em>namespace-definition</em>⁠s is exported, or </s>if it contains any <em>export-declaration</em>⁠s ([module.interface]). A namespace is never attached to a <u>named </u>module<s>,</s> and never has <u>a name with </u>module linkage<s> even if it is not exported</s>. — <em>end note</em>] [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 3:</p>
<blockquote>
<p><s>The outermost declarative region of a translation unit</s><u>There</u> is a <s>namespace</s><u><em>global namespace</em> with no declaration</u>; see [basic.scope.namespace]. <u>The global namespace belongs to the global scope; it is not an unnamed namespace ([namespace.unnamed]). [<em>Note</em>: Lacking a declaration, it cannot be found by name lookup. — <em>end note</em>]</u></p>
</blockquote>
<h4 id="namespace.def">#[namespace.def]</h4>
<p>Change paragraph 1:</p>
<blockquote>
<p>Every <em>namespace-definition</em> shall <s>appear at</s><u>inhabit a</u> namespace scope ([basic.scope.namespace]).</p>
</blockquote>
<p>Change paragraph 2:</p>
<blockquote>
<p>In a <em>named-namespace-definition</em><u> <em>D</em></u>, the <em>identifier</em> is the name of the namespace. <s>If t</s><u>T</u>he <em>identifier</em><s>, when</s><u>is</u> looked up<s> ([basic.lookup.unqual]), refers to a <em>namespace-name</em> (but not a <em>namespace-alias</em>) that was introduced</s><u> by searching for it</u> in the <u>scopes of the </u>namespace<u> <em>A</em></u> in which <s>the <em>named-namespace-definition</em></s><u><em>D</em></u> appears <s>or that was introduced in a member</s><u>and of every element</u> of the inline namespace set of <s>that namespace</s><u><em>A</em>. If the lookup finds a <em>namespace-definition</em> for a namespace <em>N</em></u>, <s>the <em>namespace-definition</em></s><u><em>D</em></u> <em>extends</em> <s>the previously-declared namespace</s><u><em>N</em>, and the target scope of <em>D</em> is the scope to which <em>N</em> belongs</u>. <s>Otherwise</s><u>If the lookup finds nothing</u>, the <em>identifier</em> is introduced as a <em>namespace-name</em> into <s>the declarative region in which the <em>named-namespace-definition</em> appears</s><u><em>A</em></u>.</p>
</blockquote>
<p>Remove paragraph 4 (whose example is adapted in [basic.scope.namespace]/1):</p>
<div class="del">
<blockquote>
<p>The <em>enclosing namespaces</em> of a declaration are […]</p>
</blockquote>
</div>
<p>Change paragraph 7:</p>
<blockquote>
<p>[…] Finally, looking up a name in the enclosing namespace via explicit qualification ([namespace.qual]) will include members of the inline namespace<s> brought in by the <em>using-directive</em></s> even if there are declarations of that name in the enclosing namespace.</p>
</blockquote>
<p>Change paragraph 8:</p>
<blockquote>
<p>These properties are transitive: if a namespace <code>N</code> contains an inline namespace <code>M</code>, which in turn contains an inline namespace <code>O</code>, then the members of <code>O</code> can be used as though they were members of <code>M</code> or <code>N</code>. The <em>inline namespace set</em> of <code>N</code> is the transitive closure of all inline namespaces in <code>N</code>. <s>The <em>enclosing namespace set</em> of <code>O</code> is the set of namespaces consisting of the innermost non-inline namespace enclosing an inline namespace <code>O</code>, together with any intervening inline namespaces.</s></p>
</blockquote>
<div class="del">
<h5>#[namespace.memdef]</h5>
</div>
<p>Remove subclause, referring the stable name to [namespace.def]. Remove the cross-reference parenthetical in [namespace.def]/4 and update those in [temp.class.spec]/6 and [temp.expl.spec]/3 to refer to [dcl.meaning].</p>
<p>The examples in paragraphs 2 and 3 are moved to [dcl.meaning] and [class.friend]/11 respectively.</p>
<h4 id="namespace.alias">#[namespace.alias]</h4>
<p>Change paragraph 2:</p>
<blockquote>
<p>The <em>identifier</em> in a <em>namespace-alias-definition</em> <s>is</s><u>becomes</u> a <s>synonym for the name of</s><u><em>namespace-alias</em> and denotes</u> the namespace denoted by the <em>qualified-namespace-specifier</em><s> and becomes a <em>namespace-alias</em></s>. [<em>Note</em>: When looking up a <em>namespace-name</em> in a <em>namespace-alias-definition</em>, only namespace names are considered, see [basic.lookup.udir]. — <em>end note</em>]</p>
</blockquote>
<p>Remove paragraph 3 (whose example is adapted in [basic.scope.scope]):</p>
<div class="del">
<blockquote>
<p>In a declarative region, a <em>namespace-alias-definition</em> can be used to redefine […]</p>
</blockquote>
</div>
<h4 id="namespace.udir">#[namespace.udir]</h4>
<p>Change paragraph 2:</p>
<blockquote>
<p><u>[<em>Note</em>: </u>A <em>using-directive</em> <s>specifies that</s><u>makes</u> the names in the nominated namespace <s>can be used</s><u>usable</u> in the scope in which the <em>using-directive</em> appears after the <em>using-directive</em><u> ([basic.lookup.unqual], [namespace.qual])</u>. During unqualified name lookup<s> ([basic.lookup.unqual])</s>, the names appear as if they were declared in the nearest enclosing namespace which contains both the <em>using-directive</em> and the nominated namespace. <s>[<em>Note</em>: In this context, “contains” means “contains directly or indirectly”.</s> — <em>end note</em>]</p>
</blockquote>
<p>Change paragraph 3:</p>
<blockquote>
<p><u>[<em>Note</em>: </u>A <em>using-directive</em> does not <s>add any members to the declarative region in which it appears</s><u>introduce any names</u>.<u> — <em>end note</em>]</u> [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 4:</p>
<blockquote>
<p><s>For unqualified lookup ([basic.lookup.unqual]), the</s><u>[<em>Note</em>: A</u> <em>using-directive</em> is transitive: if a scope contains a <em>using-directive</em> that nominates a <s>second </s>namespace that itself contains <em>using-directive</em>⁠s, the <s>effect is as if the</s><u>namespaces nominated by those</u> <em>using-directive</em>⁠s <s>from the second namespace</s><u>are</u> also <s>appeared in the first</s><u>eligible to be considered</u>. <s>[<em>Note</em>: For qualified lookup, see [namespace.qual].</s> — <em>end note</em>] [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 5:</p>
<blockquote>
<p><s>If</s><u>[<em>Note</em>: Declarations in</u> a namespace <s>is extended ([namespace.def])</s><u>that appear</u> after a <em>using-directive</em> for that namespace <s>is given, the additional members of the extended namespace and the members of namespaces nominated by</s><u>can be found through that</u> <em>using-directive</em><s>⁠s in the extending <em>namespace-definition</em> can be used after the extending <em>namespace-definition</em></s><u> after they appear</u>.<u> — <em>end note</em>]</u></p>
</blockquote>
<p>Change paragraph 7:</p>
<blockquote>
<p><s>During overload resolution, all functions from the transitive search are considered for argument matching. The set of declarations found by the transitive search is unordered.</s> [<em>Note</em>: <s>In particular, t</s><u>T</u>he order in which namespaces <s>we</s><u>a</u>re considered and the relationships among the namespaces implied by the <em>using-directive</em>⁠s do not <s>cause preference to be given to any of the declarations found by the search</s><u>affect overload resolution</u>.<s> — <em>end note</em>]</s> <s>An ambiguity exists if the best match finds two functions with</s><u>Neither is any function excluded because another has</u> the same signature, even if one is in a namespace reachable through <em>using-directive</em>⁠s in the namespace of the other.<sup>[…]</sup><u> — <em>end note</em>]</u> [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<h4 id="namespace.udecl">#[namespace.udecl]</h4>
<p>Change and split paragraph 1:</p>
<blockquote>
<p><u>The component names of a <em>using-declarator</em> are those of its <em>nested-name-specifier</em> and <em>unqualified-id</em>.</u> Each <em>using-declarator</em> in a <em>using-declaration</em><sup>[…]</sup> <s>introduces a set of declarations into the declarative region in which the <em>using-declaration</em> appears. The</s><u>names the</u> set of declarations<s> introduced by the <em>using-declarator</em> is</s> found by <s>performing qualified name </s>lookup ([basic.lookup.qual]<s>, [class.member.lookup]</s>) for <s>the name in </s>the <em>using-declarator</em>, <s>excluding</s><u>except that class and enumeration declarations that would be discarded are merely ignored when checking for ambiguity ([basic.lookup]), conversion function templates with a dependent return type are ignored, and certain</u> functions <s>that </s>are hidden as described below.<!-- remote --> <u>If the terminal name of the <em>using-declarator</em> is dependent ([temp.dep.type]), the <em>using-declarator</em> is considered to name a constructor if and only if the <em>nested-name-specifier</em> has a terminal name that is the same as the <em>unqualified-id</em>. If the lookup in any instantiation finds that a <em>using-declarator</em> that is not considered to name a constructor does do so, or that a <em>using-declarator</em> that is considered to name a constructor does not, the program is ill-formed.</u></p>
</blockquote>
<blockquote>
<p><s>If the <em>using-declarator</em> does not name a constructor, the <em>unqualified-id</em> is declared in the declarative region in which the <em>using-declaration</em> appears as a synonym for each declaration introduced by the <em>using-declarator</em>. [<em>Note</em>: Only the specified name is so declared; specifying an enumeration name in a <em>using-declaration</em> does not declare its enumerators in the <em>using-declaration</em>’s declarative region. — <em>end note</em>]</s> If the <em>using-declarator</em> names a constructor, it declares that the class <em>inherits</em> the <u>named </u>set of constructor declarations<s> introduced by the <em>using-declarator</em></s> from the nominated base class. <u>[<em>Note</em>: Otherwise, the <em>unqualified-id</em> in the <em>using-declarator</em> is bound to the <em>using-declarator</em>, which is replaced during name lookup with the declarations it names ([basic.lookup]). If such a declaration is of an enumeration, the names of its enumerators are not bound. For the keyword <code>typename</code>, see [temp.res]. — <em>end note</em>]</u></p>
</blockquote>
<p>Remove paragraph 2 (part of whose example is merged into another below):</p>
<div class="del">
<blockquote>
<p>Every <em>using-declaration</em> is a <em>declaration</em> and a <em>member-declaration</em> […]</p>
</blockquote>
</div>
<p>Change paragraph 3, combining its latter two examples with that from /2 (in the given order and with changes as marked):</p>
<blockquote>
<p>In a <em>using-declaration</em> used as a <em>member-declaration</em>, each <em>using-declarator</em> shall either name an enumerator or have a <em>nested-name-specifier</em> naming a base class of the <u>current </u>class<s> being defined</s>. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>] If a <em>using-declarator</em> names a constructor, its <em>nested-name-specifier</em> shall name a direct base class of the <u>current </u>class<s> being defined</s>. <u>If the immediate (class) scope is associated with a class template, it shall derive from the specified base class or have at least one dependent base class.</u> <s>[<em>Example</em>:</s></p>
<p><s>[…]</s></p>
<s>— <em>end example</em>]</s> [<em>Example</em>:
<pre class="cpp">
struct B {
  void f(char);
<s>  void g(char);
</s>  enum E { e };
  union { int x; };
};

<s>struct D : B {
  using B::f;
  void f(int) { f('c'); }       // calls B::f(char)
  void g(int) { g('c'); }       // recursively calls D::g(int)
};
</s>
<s>class</s><u>struct</u> C {
  int <s>g</s><u>f</u>();
};

<s>class</s><u>struct</u> D<s>2</s> : <s>public </s>B {
  using B::f;                   // OK: B is a base of D<s>2</s>
  using B::e;                   // OK: e is an enumerator of base B
  using B::x;                   // OK: x is a union member of base B
  using C::<s>g</s><u>f</u>;                   // error: C isn't a base of D<s>2</s>
<u>  void f(int) { f('c'); }       // calls B::f(char)
  void g(int) { g('c'); }       // recursively calls D::g(int)
</u>};

template &lt;typename... bases&gt;
struct X : bases... {
  using bases::<s>g</s><u>f</u>...;
};

X&lt;B, <s>D</s><u>C</u>&gt; x;                      // OK: B::<s>g</s><u>f</u> and <s>D</s><u>C</u>::<s>g</s><u>f</u> <s>introduced</s><u>named</u>
</pre>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 4:</p>
<blockquote>
<p>[<em>Note</em>: Since destructors do not have names, a <em>using-declaration</em> cannot refer to a destructor for a base class. <s>Since specializations of member templates for conversion functions are not found by name lookup, they are not considered when a <em>using-declaration</em> specifies a conversion function ([temp.mem]).</s> — <em>end note</em>] If a constructor or assignment operator brought from a base class into a derived class has the signature of a copy/move constructor or assignment operator for the derived class ([class.copy.ctor], [class.copy.assign]), the <em>using-declaration</em> does not by itself suppress the implicit declaration of the derived class member; the member from the base class is hidden or overridden by the implicitly-declared copy/move constructor or assignment operator of the derived class, as described below.</p>
</blockquote>
<p>Replace paragraphs 8 and 9:</p>
<div class="del">
<blockquote>
<p>Members declared by a <em>using-declaration</em> can be referred to by explicit qualification just like other member names ([namespace.qual]). [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<blockquote>
<p>A <em>using-declaration</em> is a <em>declaration</em> and can therefore be used repeatedly where (and only where) multiple declarations are allowed. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
</div>
<div class="ins">
<blockquote>
<p>If a declaration is named by two <em>using-declarator</em>⁠s that inhabit the same class scope, the program is ill-formed.</p>
</blockquote>
</div>
<p>Change paragraph 10:</p>
<blockquote>
<p>[<em>Note</em>: <s>For a</s><u>A</u> <em>using-declarat<s>ion</s><u>or</u></em> whose <em>nested-name-specifier</em> names a namespace<s>, members</s><u> does not name declarations</u> added to the namespace after <s>the <em>using-declaration</em> are not in the set of introduced declarations, so they are not considered when a use of the name is made</s><u>it</u>. Thus, additional overloads added after the <em>using-declaration</em> are ignored, but default function arguments ([dcl.fct.default]), default template arguments ([temp.param]), and template specializations ([temp.class.spec], [temp.expl.spec]) are considered. — <em>end note</em>] [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Remove paragraph 11:</p>
<div class="del">
<blockquote>
<p>[<em>Note</em>: Partial specializations of class templates are found by looking up the primary class template […] — <em>end note</em>]</p>
</blockquote>
</div>
<p>Change paragraph 12:</p>
<blockquote>
<s>Since a <em>using-declaration</em> is a declaration, the restrictions on declarations of the same name in the same declarative region ([basic.scope]) also apply to <em>using-declaration</em>⁠s.</s> <u>If a declaration named by a <em>using-declaration</em> that inhabits the target scope of another declaration potentially conflicts with it ([basic.scope.scope]) and either is reachable from the other, the program is ill-formed. If two declarations named by <em>using-declaration</em>⁠s that inhabit the same scope potentially conflict, either is reachable from the other, and they do not both declare functions or function templates, the program is ill-formed. [<em>Note</em>: Overload resolution may not be able to distinguish between conflicting function declarations. — <em>end note</em>]</u> [<em>Example</em>:
<pre class="cpp">
namespace A {
  int x;
<u>  int f(int);
  int g;
  void h();
</u>}

namespace B {
  int i;
  struct g { };
  struct x { };
  void f(int);
  void f(double);
  void g(char);     // OK: hides struct g
}

void func() {
  int i;
  using B::i;       // error: <s>i declared twice</s><u>conflicts</u>
  void f(char);
  using B::f;       // OK: each f is a function
<u>  using A::f;       // OK, but interferes with B::f(int)
  f(1);             // error: ambiguous
  static_cast&lt;int(*)(int)&gt;(f)(1);  // OK: calls A::f
</u>  f(3.5);           // calls B::f(double)
  using B::g;
  g('a');           // calls B::g(char)
  struct g g1;      // g1 has class type B::g
<u>  using A::g;       // error: conflicts with B::g
  void h();
  using A::h;       // error: conflicts
</u>  using B::x;
  using A::x;       // OK: hides struct B::x
  x = 99;           // assigns to A::x
  struct x x1;      // x1 has class type B::x
}
</pre>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Remove paragraph 13 (whose example is merged into the above):</p>
<div class="del">
<blockquote>
<p>If a function declaration in namespace scope or block scope has the same name and the same parameter-type-list ([dcl.fct]) as […]</p>
</blockquote>
</div>
<p>Change paragraph 14:</p>
<blockquote>
<p><s>When</s><u>The set of declarations named by</u> a <em>using-declarator</em> <s>brings declarations from a base class into a derived class,</s><u>that inhabits a class <code>C</code> does not include</u> member functions and member function templates <s>in the derived</s><u>of a base</u> class <s>override and/or hide member functions and member function templates with the same name, parameter-type-list ([dcl.fct]), trailing <em>requires-clause</em> (if any), cv-qualification, and <em>ref-qualifier</em> (if any), in a base class</s><u>that correspond to</u> (<s>rather than</s><u>and thus would</u> conflict<s>ing</s><u> with</u>)<u> a declaration of a function or function template in <code>C</code></u>. <s>Such hidden or overridden declarations are excluded from the set of declarations introduced by the <em>using-declarator</em>.</s> [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 15:</p>
<blockquote>
<p>[<em>Note</em>: For the purpose of forming a set of candidates during overload resolution, the functions <s>that are introduced</s><u>named</u> by a <em>using-declaration</em> in<s>to</s> a derived class are treated as though they were <u>direct </u>members of the derived class<s> ([class.member.lookup])</s>. In particular, the implicit object parameter is treated as if it were a reference to the derived class rather than to the base class ([over.match.funcs]). This has no effect on the type of the function, and in all other respects the function remains <s>a member</s><u>part</u> of the base class. — <em>end note</em>]</p>
</blockquote>
<p>Change paragraph 16:</p>
<blockquote>
<p>Constructors that are <s>introduced</s><u>named</u> by a <em>using-declaration</em> are treated as though they were constructors of the derived class when looking up the constructors of the derived class ([class.qual]) or forming a set of overload candidates ([over.match.ctor], [over.match.copy], [over.match.list]).<!-- remote --> [<em>Note</em>: If such a constructor is selected to perform the initialization of an object of class type, all subobjects other than the base class from which the constructor originated are implicitly initialized ([class.inhctor.init]). A constructor of a derived class is sometimes preferred to a constructor of a base class if they would otherwise be ambiguous ([over.match.best]). — <em>end note</em>]</p>
</blockquote>
<p>Change paragraph 17:</p>
<blockquote>
<p>In a <em>using-declarator</em> that does not name a constructor, <s>all members of the set of introduced</s><u>every</u> declaration<s>s</s><u> named</u> shall be accessible. In a <em>using-declarator</em> that names a constructor, no access check is performed. <s>In particular, if a derived class uses a <em>using-declarator</em> to access a member of a base class, the member name shall be accessible. If the name is that of an overloaded member function, then all functions named shall be accessible. The base class members mentioned by a <em>using-declarator</em> shall be visible in the scope of at least one of the direct base classes of the class where the <em>using-declarator</em> is specified.</s></p>
</blockquote>
<p>Change paragraph 19:</p>
<blockquote>
<p>A <s>synonym created by a </s><em>using-declaration</em> has the usual accessibility for a <em>member-declaration</em>. <s>A</s><u>Base-class constructors considered because of a</u> <em>using-declarator</em><s> that names a constructor does not create a synonym; instead, the additional constructors</s> are accessible if they would be accessible when used to construct an object of the <s>corresponding </s>base class<s>, and</s><u>;</u> the accessibility of the <em>using-declaration</em> is ignored. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Remove paragraph 20:</p>
<div class="del">
<blockquote>
<p>If a <em>using-declarator</em> uses the keyword <code>typename</code> and specifies a dependent name ([temp.dep]), […]</p>
</blockquote>
</div>
<h3 id="dcl.link">#[dcl.link]</h3>
<p>Change paragraph 1:</p>
<blockquote>
<p>All <s>function types, </s>function<u>s</u><s> names with external linkage,</s> and variable<u>s whose</u> names <s>with</s><u>have</u> external linkage<u> and all function types</u> have a <em>language linkage</em>. [<em>Note</em>: Some of the properties associated with an entity with language linkage are specific to each implementation and are not described here. For example, a particular language linkage may be associated with a particular form of representing names of objects and functions with external linkage, or with a particular calling convention, etc. — <em>end note</em>] The default language linkage of all function types, function<u>s</u><s> names</s>, and variable<u>s</u><s> names</s> is C++ language linkage. Two function types with different language linkages are distinct types even if they are otherwise identical.</p>
</blockquote>
<p>Change paragraph 3:</p>
<blockquote>
<p>Every implementation shall provide for linkage to <s>functions written in </s>the C programming language, <code>&quot;C&quot;</code>, and <s>linkage to </s>C++<s> functions</s>, <code>&quot;C++&quot;</code>. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 5:</p>
<blockquote>
<p>Linkage specifications nest. When linkage specifications nest, the innermost one determines the language linkage. <u>[<em>Note</em>: </u>A linkage specification does not establish a scope.<u> — <em>end note</em>]</u> A <em>linkage-specification</em> shall <s>occur only in</s><u>inhabit a</u> namespace scope<s> ([basic.scope])</s>. In a <em>linkage-specification</em>, the specified language linkage applies to the function types of all function declarators<s>,</s><u> and to all</u> function<u>s</u><s> names with external linkage,</s> and variable<u>s</u><s> names with external linkage declared within the <em>linkage-specification</em></s>. [<em>Example</em>:</p>
<pre class="cpp">
extern "C"                      // <s>the name </s>f1 and its function type have C language linkage;
  void f1(void(*pf)(int));      // pf is a pointer to a C function

extern "C" typedef void FUNC();
FUNC f2;                        // <s>the name </s>f2 has C++ language linkage and<s> the</s>
                                // <s>function's</s><u>its</u> type has C language linkage

extern "C" FUNC f3;             // <s>the name of function </s>f3 and <s>the function's</s><u>its</u> type have C language linkage

void (*pf2)(FUNC*);             // <s>the name of </s>the variable pf2 has C++ linkage<s> and the</s><u>; its</u> type
                                // <s>of pf2 </s>is "pointer to C++ function that takes one parameter of type
                                // pointer to C function"
extern "C" {
  static void f4();             // the name of the function f4 has internal linkage<s> (not C language linkage)</s><u>,</u>
                                // <s>and the function's</s><u>so f4 has no language linkage; its</u> type has C language linkage<s>.</s>
}
</pre>
<p>[…]</p>
<p>— <em>end example</em>] A C language linkage is ignored in determining the language linkage of <s>the names of </s>class members and the function type of class member functions. [<em>Example</em>:</p>
<pre class="cpp">
extern "C" typedef void FUNC_c();

class C {
  void mf1(FUNC_c*);            // <s>the name of </s>the function mf1 and <s>the member function's</s><u>its</u> type have<u> C++ language linkage;</u>
                                // <s>C++ language linkage; </s>the parameter has type "pointer to C function"

  FUNC_c mf2;                   // <s>the name of </s>the function mf2 and <s>the member function's</s><u>its</u> type have<u> C++ language linkage</u><s>
                                // C++ language linkage</s>

  static FUNC_c* q;             // <s>the name of </s>the data member q has C++ language linkage<s> and</s><u>;</u>
                                // <s>the data member's</s><u>its</u> type is "pointer to C function"
};

extern "C" {
  class X {
    void mf();                  // <s>the name of </s>the function mf and <s>the member function's</s><u>its</u> type have<u> C++ language linkage</u><s>
                                // C++ language linkage</s>
    void mf2(void(*)());        // <s>the name of </s>the function mf2 has C++ language linkage;
                                // the parameter has type "pointer to C function"
  };
}
</pre>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 6:</p>
<blockquote>
<p>If two declarations <s>declare functions with the same name and parameter-type-list ([dcl.fct]) to be members of the same namespace or declare objects with the same name to be members of the same namespace and the declarations</s><u>of an entity</u> give <s>the names</s><u>it</u> different language linkages, the program is ill-formed; no diagnostic is required if <s>the</s><u>neither</u> declaration<s>s appear in different translation units</s><u> is reachable from the other</u>. <s>Except for functions with C++ linkage, a function declaration without a linkage specification shall not precede the first linkage specification for that function.</s> A <s>function can be declared</s><u>redeclaration of an entity</u> without a linkage specification <s>after an explicit linkage specification has been seen; the linkage explicitly specified in the earlier declaration is not affected by such a function declaration</s><u>inherits the language linkage of the entity and (if applicable) its type</u>.</p>
</blockquote>
<p>Change paragraph 7:</p>
<blockquote>
<p><s>At most one function with a particular name can have C language linkage.</s> Two declarations <s>for</s><u>declare the same entity if they (re)introduce the same name, one declares</u> a function<u> or variable</u> with C language linkage<s> with the same function name (ignoring the namespace names that qualify it) that appear in different namespace scopes refer to the same function</s><u>, and the other declares such an entity or a variable that belongs to the global scope</u>. <s>Two declarations for a variable with C language linkage with the same name (ignoring the namespace names that qualify it) that appear in different namespace scopes refer to the same variable. An entity with C language linkage shall not be declared with the same name as a variable in global scope, unless both declarations denote the same entity; no diagnostic is required if the declarations appear in different translation units. A variable with C language linkage shall not be declared with the same name as a function with C language linkage (ignoring the namespace names that qualify the respective names); no diagnostic is required if the declarations appear in different translation units. [<em>Note</em>: Only one definition for an entity with a given name with C language linkage may appear in the program (see [basic.def.odr]); this implies that such an entity must not be defined in more than one namespace scope. — <em>end note</em>]</s> [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<h3 id="dcl.attr.nodiscard">#[dcl.attr.nodiscard]</h3>
<p>Change paragraph 2:</p>
<blockquote>
<p>A<u>n</u> <s>name or </s>entity declared without the <code>nodiscard</code> attribute can later be redeclared with the attribute and vice-versa. […]</p>
</blockquote>
<h2 id="module">#[module]</h2>
<h3 id="module.unit">#[module.unit]</h3>
<p>Change paragraph 7:</p>
<blockquote>
<p>A <em>module</em> is either a named module or the global module. A declaration is <em>attached</em> to a module as follows:</p>
<ol style="list-style-type: decimal">
<li><u>If the declaration is a non-dependent friend declaration that nominates a function with a <em>declarator-id</em> that is a <em>qualified-id</em> or <em>template-id</em> or that nominates a class other than with an <em>elaborated-type-specifier</em> with neither a <em>nested-name-specifier</em> nor a <em>simple-template-id</em>, it is attached to the module to which the friend is attached ([basic.link]).</u></li>
<li><s>I</s><u>Otherwise, i</u>f the declaration
<ol style="list-style-type: decimal">
<li>is a replaceable global allocation or deallocation function ([new.delete.single], [new.delete.array]), or</li>
<li>is a <em>namespace-definition</em> with external linkage, or</li>
<li>appears within a <em>linkage-specification</em>,</li>
</ol>
it is attached to the global module.</li>
<li>Otherwise, the declaration is attached to the module in whose purview it appears.</li>
</ol>
</blockquote>
<h3 id="module.interface">#[module.interface]</h3>
<p>Change paragraph 1:</p>
<blockquote>
<p>An <em>export-declaration</em> shall <s>appear only at</s><u>inhabit a</u> namespace scope and <s>only</s><u>appear</u> in the purview of a module interface unit. An <em>export-declaration</em> shall not appear directly or indirectly within an unnamed namespace or a <em>private-module-fragment</em>. An <em>export-declaration</em> has the declarative effects of its <em>declaration</em>, <em>declaration-seq</em> (if any), or <em>module-import-declaration</em>. <s>An <em>export-declaration</em> does not establish a scope and its</s><u>The</u> <em>declaration</em> or <em>declaration-seq</em><u> of an <em>export-declaration</em></u> shall not contain an <em>export-declaration</em> or <em>module-import-declaration</em>. <u>[<em>Note</em>: An <em>export-declaration</em> does not establish a scope. — <em>end note</em>]</u></p>
</blockquote>
<p>Change paragraph 2:</p>
<blockquote>
<p>A declaration is <em>exported</em> if it is<s>a namespace-scope declaration</s> declared within an <em>export-declaration</em><s>,</s><u> and inhabits a namespace scope</u> or<u> it is</u></p>
<ol style="list-style-type: decimal">
<li>a <em>namespace-definition</em> that contains an exported declaration<s>,</s> or</li>
<li>a declaration within a header unit ([module.import]) that introduces at least one name.</li>
</ol>
</blockquote>
<p>Change paragraph 6:</p>
<blockquote>
<p>A redeclaration of <s>an exported declaration of </s>an entity<u> or <em>typedef-name</em> <em>X</em></u> is implicitly exported<u> if <em>X</em> was introduced by an exported declaration; otherwise it shall not be exported</u>. <s>An exported redeclaration of a non-exported declaration of an entity is ill-formed.</s> [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 7:</p>
<blockquote>
<p><s>A name is <em>exported</em> by a module if it is introduced or redeclared by an exported declaration in the purview of that module.</s> [<em>Note</em>: <u>Names introduced by e</u><s>E</s>xported <s>names</s><u>declarations</u> have either external linkage or no linkage; see [basic.link]. Namespace-scope <s>names</s><u>declarations</u> exported by a module <s>are visible to</s><u>can be found by</u> name lookup in any translation unit importing that module<s>; see </s><u> (</u>[basic.<s>scope.namespace</s><u>lookup</u>]<u>)</u>. Class and enumeration member names <s>are visible to</s><u>can be found by</u> name lookup in any context in which a definition of the type is reachable. — <em>end note</em>] [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Remove paragraph 8:</p>
<div class="del">
<blockquote>
<p>[<em>Note</em>: Redeclaring a name in an <em>export-declaration</em> cannot change the linkage of the name ([basic.link]). [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>] — <em>end note</em>]</p>
</blockquote>
</div>
<h3 id="module.import">#[module.import]</h3>
<p>Change paragraph 1:</p>
<blockquote>
<p>A <em>module-import-declaration</em> shall <s>only appear at</s><u>inhabit the</u> global<s> namespace</s> scope. In a module unit, all <em>module-import-declaration</em>⁠s and <em>export-declaration</em>⁠s exporting <em>module-import-declaration</em>⁠s shall <s>precede</s><u>appear before</u> all other <em>declaration</em>⁠s in the <em>declaration-seq</em> of the <em>translation-unit</em> and of the <em>private-module-fragment</em> (if any). The optional <em>attribute-specifier-seq</em> appertains to the <em>module-import-declaration</em>.</p>
</blockquote>
<p>Change paragraph 2:</p>
<blockquote>
<p>A <em>module-import-declaration</em> <em>imports</em> a set of translation units determined as described below. [<em>Note</em>: Namespace-scope <s>names</s><u>declarations</u> exported by the imported translation units <s>become visible</s><u>can be found by name lookup</u> ([basic.<s>scope.namespace</s><u>lookup</u>]) in the importing translation unit and declarations within the imported translation units become reachable ([module.reach]) in the importing translation unit after the import declaration. — <em>end note</em>]</p>
</blockquote>
<p>Change the footnote in paragraph 7:</p>
<blockquote>
<p>This is consistent with the <u>lookup </u>rules for <s>visibility of </s>imported names ([basic.<s>scope.namespace</s><u>lookup</u>]).</p>
</blockquote>
<h3 id="module.global.frag">#[module.global.frag]</h3>
<p>Change bullet (3.3):</p>
<blockquote>
<p><em>S</em> contains a<s>n expression</s><u> dependent call</u> <code>E</code><s> of the form</s></p>
<blockquote>
<p><s><em>postfix-expression</em> <code>(</code> <em>expression-list</em><sub><em>opt</em></sub> <code>)</code></s></p>
</blockquote>
<p><s>whose <em>postfix-expression</em> denotes a dependent name, or for an operator expression whose operator denotes a dependent name,</s><u> ([temp.dep])</u> and <em>D</em> is found by name lookup for the <s>corresponding</s><u>dependent</u> name in an expression synthesized from <code>E</code> by replacing each type-dependent argument or operand with a value of a placeholder type with no associated namespaces or entities, or</p>
</blockquote>
<p>Change bullet (3.4):</p>
<blockquote>
<p><em>S</em> contains an expression that takes the address of an overload<s>ed function</s><u> set</u> ([over.over]) <s>whose set of overloads</s><u>that</u> contains <em>D</em> and for which the target type is dependent, or</p>
</blockquote>
<p>Change bullet (3.7):</p>
<blockquote>
<p><em>D</em> redeclares the entity declared by <em>M</em> or <em>M</em> redeclares the entity declared by <em>D</em>, and <em>D</em> <s>is </s>neither<u> is</u> a friend declaration nor <u>inhabits </u>a block<s>-</s><u> </u>scope<s> declaration</s>, or</p>
</blockquote>
<h3 id="module.context">#[module.context]</h3>
<p>Change paragraph 1:</p>
<blockquote>
<p>The <em>instantiation context</em> is a set of points within the program that determines which <s>names</s><u>declarations</u> are <s>visible to</s><u>found by</u> argument-dependent name lookup ([basic.lookup.argdep]) and which <s>declarations </s>are reachable ([module.reach]) in the context of a particular declaration or template instantiation.</p>
</blockquote>
<h3 id="module.reach">#[module.reach]</h3>
<p>Change paragraph 1:</p>
<blockquote>
<p>A translation unit <em>U</em> is <em>necessarily reachable</em> from a point <em>P</em> if <em>U</em> is a module interface unit on which the translation unit containing <em>P</em> has an interface dependency, or the translation unit containing <em>P</em> imports <em>U</em>, in either case prior to <em>P</em> ([module.import]). [<em>Note</em>: While module interface units are reachable even when they are only transitively imported via a non-exported import declaration, namespace-scope names from such module interface units are not <s>visible to</s><u>found by</u> name lookup ([basic.<s>scope.namespace</s><u>lookup</u>]). — <em>end note</em>]</p>
</blockquote>
<p>Change paragraph 3:</p>
<blockquote>
<p>A declaration <em>D</em> is <em>reachable<u> from</u></em> <s>if, for any</s><u>a</u> point <em>P</em> <s>in the instantiation context ([module.context]),</s><u>if</u></p>
<ol style="list-style-type: decimal">
<li><em>D</em> appears prior to <em>P</em> in the same translation unit, or</li>
<li><em>D</em> is not discarded ([module.global.frag]), appears in a translation unit that is reachable from <em>P</em>, and does not appear within a <em>private-module-fragment</em>.</li>
</ol>
<p><u>A declaration is <em>reachable</em> if it is reachable from any point in the instantiation context ([module.context]).</u> [<em>Note</em>: Whether a declaration is exported has no bearing on whether it is reachable. — <em>end note</em>]</p>
</blockquote>
<p>Change paragraph 4:</p>
<blockquote>
<p>The accumulated properties of all reachable declarations of an entity within a context determine the behavior of the entity within that context. [<em>Note</em>: These reachable semantic properties include type completeness, type definitions, initializers, default arguments of functions or template declarations, attributes, <s>visibility of class or enumeration member </s>names <s>to ordinary lookup</s><u>bound</u>, etc. Since default arguments are evaluated in the context of the call expression, the reachable semantic properties of the corresponding parameter types apply in that context. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>] — <em>end note</em>]</p>
</blockquote>
<p>Change paragraph 5:</p>
<blockquote>
<p>[<em>Note</em>: <u>Declarations of a</u><s>A</s>n entity can <s>have</s><u>be</u> reachable<s> declarations</s> even <s>if it is not visible to</s><u>where they cannot be found by</u> name lookup. — <em>end note</em>] [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<h2 id="class">#[class]</h2>
<h3 id="class.pre">#[class.pre]</h3>
<p>Change paragraph 1:</p>
<blockquote>
<p>[…]</p>
<p>A class declaration where the <em>class-name</em> in the <em>class-head-name</em> is a <em>simple-template-id</em> shall be an explicit specialization ([temp.expl.spec]) or a partial specialization ([temp.class.spec]). A <em>class-specifier</em> whose <em>class-head</em> omits the <em>class-head-name</em> defines an unnamed class. [<em>Note</em>: An unnamed class thus can’t be <code>final</code>. — <em>end note</em>] <u>Otherwise, the <em>class-name</em> is an <em>identifier</em>; it is not looked up, and the <em>class-specifier</em> introduces it.</u></p>
</blockquote>
<p>Change paragraph 2:</p>
<blockquote>
<p><s>A <em>class-name</em> is inserted into the scope in which it is declared immediately after the <em>class-name</em> is seen.</s> The <em>class-name</em> is also <s>inserted into</s><u>bound in</u> the scope of the class<u> (template)</u> itself; this is known as the <em>injected-class-name</em>. […]</p>
</blockquote>
<p>Change paragraph 3:</p>
<blockquote>
<p>If a <em>class-head-name</em> contains a <em>nested-name-specifier</em>, the <em>class-specifier</em> shall <s>refer to a class that was previously declared directly in</s><u>not inhabit a class scope. If its <em>class-name</em> is an <em>identifier</em>, the <em>class-specifier</em> shall correspond to one or more declarations nominable in</u> the class<u>, class template,</u> or namespace to which the <em>nested-name-specifier</em> refers<s>, or in an element of the inline namespace set ([namespace.def]) of that namespace (i.e., not merely inherited or introduced by a <em>using-declaration</em>), and</s><u>; they shall all have the same target scope, and the target scope of</u> the <em>class-specifier</em> <s>the <em>class-specifier</em> shall appear in a namespace enclosing the previous declaration</s><u>is that scope</u>. <s>In such cases, the <em>nested-name-specifier</em> of the <em>class-head-name</em> of the definition shall not begin with a <em>decltype-specifier</em>.</s> <u>[<em>Example</em>:</u></p>
<pre class="sourceCode cpp ins"><code class="sourceCode cpp"><span class="kw">namespace</span> N {
  <span class="kw">template</span>&lt;<span class="kw">class</span>&gt;
  <span class="kw">struct</span> A {
    <span class="kw">struct</span> B;
  };
}
<span class="kw">using</span> N::A;
<span class="kw">template</span>&lt;<span class="kw">class</span> T&gt; <span class="kw">struct</span> A&lt;T&gt;::B {};  <span class="co">// OK</span>
<span class="kw">template</span>&lt;&gt; <span class="kw">struct</span> A&lt;<span class="dt">void</span>&gt; {};         <span class="co">// error: A not nominable in ::</span></code></pre>
<p><u>— <em>end example</em>]</u></p>
</blockquote>
<h3 id="class.prop">#[class.prop]</h3>
<p>Change bullet (3.7.1):</p>
<blockquote>
<p>If <code>X</code> is a non-union class type with no <s>(possibly inherited ([class.derived])) </s>non-static data members, the set <em>M</em>(<code>X</code>) is empty.</p>
</blockquote>
<h3 id="class.name">#[class.name]</h3>
<p>Change paragraph 1:</p>
<blockquote>
<p>A class definition introduces a new type. [<em>Example</em>:</p>
<p>[…]</p>
<p>declare <s>an </s>overload<s>ed</s><u>s</u> ([over]) <s>function</s><u>named</u> <code>f<s>()</s></code> and not simply a single function <code>f()</code> twice. For the same reason,</p>
<p>[…] — <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 2:</p>
<blockquote>
<s>A class declaration introduces the class name into the scope where it is declared and hides any class, variable, function, or other declaration of that name in an enclosing scope ([basic.scope]).</s> <s>If</s><u>[<em>Note</em>: It may be necessary to use an <em>elaborated-type-specifier</em> to refer to</u> a class <s>name is declared in</s><u>that belongs to</u> a scope <s>where</s><u>in which its name is also bound to</u> a variable, function, or enumerator<s> of the same name is also declared, then when both declarations are in scope, the class can be referred to only using an <em>elaborated-type-specifier</em></s> ([basic.lookup.elab]). [<em>Example</em>:
<pre class="cpp">
struct stat {
  // ...
};

stat gstat;                     // use plain stat to define variable

int stat(struct stat*);         // <s>redeclare </s>stat <s>as</s><u>now also names a</u> function

void f() {
  struct stat* ps;              // struct prefix needed to name struct stat
  stat(ps);                     // call stat<s>()</s><u> function</u>
}
</pre>
<p>— <em>end example</em>] A<u>n <em>elaborated-type-specifier</em></u> <s><em>declaration</em> consisting solely of <em>class-key</em> <em>identifier</em><code>;</code> is either a redeclaration of the name in the current scope or a forward declaration of the</s><u>may also be used to declare an</u> identifier as a class name. <s>It introduces the class name into the current scope.</s> [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>] <s>[<em>Note</em>: </s>Such declarations allow definition of classes that refer to each other. [<em>Example</em>:</p>
<p>[…]</p>
<p>Declaration of friends is described in [class.friend], operator functions in [over.oper]. — <em>end example</em>] — <em>end note</em>]</p>
</blockquote>
<p>Change paragraph 3:</p>
<blockquote>
<p>[<em>Note</em>: An <em>elaborated-type-specifier</em> ([dcl.type.elab]) can also be used as a <em>type-specifier</em> as part of a declaration. It differs from a class declaration in that <s>if a class of the elaborated name is in scope the elaborated name will</s><u>it can</u> refer to <s>it</s><u>an existing class of the given name</u>. — <em>end note</em>] [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<h3 id="class.mem">#[class.mem]</h3>
<p>Change paragraph 1:</p>
<blockquote>
<p>[…] A <em>direct member</em> of a class <code>X</code> is a member of <code>X</code> that was first declared within the <em>member-specification</em> of <code>X</code>, including anonymous union <s>objects</s><u>members</u> ([class.union.anon]) and direct members thereof. […]</p>
</blockquote>
<p>Insert before paragraph 6:</p>
<div class="ins">
<blockquote>
<p>A redeclaration of a class member outside its class definition shall be a definition, an explicit specialization, or an explicit instantiation ([temp.expl.spec], [temp.explicit]). The member shall not be a non-static data member.</p>
</blockquote>
</div>
<p>Change paragraph 6:</p>
<blockquote>
<p>A <em>complete-class context</em> of a class<u> (template)</u> is a</p>
<ol style="list-style-type: decimal">
<li>function body ([dcl.fct.def.general]),</li>
<li>default argument ([dcl.fct.default]),</li>
<li><u>default template argument ([temp.param]), or</u></li>
<li><em>noexcept-specifier</em> ([except.spec]), or</li>
<li>default member initializer</li>
</ol>
<p>within the <em>member-specification</em> of the class<u> or class template</u>. [<em>Note</em>: […] — <em>end note</em>][…]</p>
</blockquote>
<h4 id="class.mfct">#[class.mfct]</h4>
<p>Change paragraph 1:</p>
<blockquote>
<p><s>A</s><u>If a</u> member function <s>may be</s><u>is attached to the global module and is</u> defined ([dcl.fct.def]) in its class definition, <s>in which case </s>it is <s>an </s>inline ([dcl.inline])<s> member function if it is attached to the global module, or it may be defined outside of its class definition if it has already been declared but not defined in its class definition</s>. [<em>Note</em>: A member function is also inline if it is declared <code>inline</code>, <code>constexpr</code>, or <code>consteval</code>. — <em>end note</em>]</p>
</blockquote>
<p>Remove paragraph 2:</p>
<div class="del">
<blockquote>
<p>A member function definition that appears outside of the class definition shall appear in a namespace scope enclosing the class definition. […]</p>
</blockquote>
</div>
<p>Change paragraph 3:</p>
<blockquote>
<p><s>If the definition of a member function is lexically outside its class definition, the member function name shall be qualified by its class name using the <code>::</code> operator. [<em>Note</em>: A name used in a member function definition (that is, in the <em>parameter-declaration-clause</em> including the default arguments ([dcl.fct.default]) or in the member function body) is looked up as described in [basic.lookup]. — <em>end note</em>]</s> [<em>Example</em>:</p>
<p>[…]</p>
<p>The <u>definition of the </u>member function <code>f</code> of class <code>X</code> <s>is defined in</s><u>inhabits the</u> global scope; the notation <code>X::f</code> <s>specifies</s><u>indicates</u> that the function <code>f</code> is a member of class <code>X</code> and in the scope of class <code>X</code>. In the function definition, the parameter type <code>T</code> refers to the typedef member <code>T</code> declared in class <code>X</code> and the default argument <code>count</code> refers to the static data member <code>count</code> declared in class <code>X</code>. — <em>end example</em>]</p>
</blockquote>
<p>Remove paragraphs 4 and 5:</p>
<div class="del">
<blockquote>
<p>[<em>Note</em>: A <code>static</code> local variable or local type in a member function always refers to the same entity, whether or not the member function is inline. — <em>end note</em>]</p>
</blockquote>
<blockquote>
<p>Previously declared member functions may be mentioned in friend declarations.</p>
</blockquote>
</div>
<h4 id="class.mfct.non-static">#[class.mfct.non-static]</h4>
<p>Change paragraph 3:</p>
<blockquote>
<p>When an <em>id-expression</em> ([expr.prim.id]) that is not part of a class member access syntax ([expr.ref]) and not used to form a pointer to member ([expr.unary.op]) is used <s>in a member of</s><u>where the current</u> class <u>is </u><code>X</code><s> in a context where <code>this</code> can be used</s> ([expr.prim.this]), if name lookup ([basic.lookup]) resolves the name in the <em>id-expression</em> to a non-static non-type member of some class <code>C</code>, and if either the <em>id-expression</em> is potentially evaluated or <code>C</code> is <code>X</code> or a base class of <code>X</code>, the <em>id-expression</em> is transformed into a class member access expression ([expr.ref]) using <code>(*this)</code><s> ([class.this])</s> as the <em>postfix-expression</em> to the left of the <code>.</code> operator. […]</p>
</blockquote>
<p>Change and combine paragraphs 4 and 5:</p>
<blockquote>
<p><u>[<em>Note</em>: </u>A non-static member function may be declared <s><code>const</code>, <code>volatile</code>, or <code>const</code> <code>volatile</code>. These</s><u>with</u> <em>cv-qualifier</em>⁠s<u>, which</u> affect the type of the <code>this</code> pointer ([<s>class</s><u>expr.prim</u>.this])<s>. They also affect the function type ([dcl.fct]) of the member function; a member function declared <code>const</code> is a <em>const member function</em>, a member function declared <code>volatile</code> is a <em>volatile member function</em> and a member function declared <code>const</code> <code>volatile</code> is a <em>const volatile member function</em>. [<em>Example</em>:</s></p>
<p><s>[…]</s></p>
<p><s><code>X::g</code> is a const member function and <code>X::h</code> is a const volatile member function. — <em>end example</em>] A non-static member function may be declared with</s><u>and/or</u> a <em>ref-qualifier</em> ([dcl.fct])<s>; see</s><u>; both affect overload resolution</u> <u>(</u>[over.match.funcs]<u>)</u>.<u> — <em>end note</em>]</u></p>
</blockquote>
<div class="del">
<h5>#[class.this]</h5>
</div>
<p>Remove subclause, referring the stable name to [expr.prim.this].</p>
<h4 id="class.ctor">#[class.ctor]</h4>
<p>Change paragraph 1:</p>
<blockquote>
<p>A <s><em>constructor</em> is introduced by a declaration whose </s><em>declarator</em><u> declares a <em>constructor</em> if it</u> is a function declarator ([dcl.fct]) of the form</p>
<blockquote>
<p><em>ptr-declarator</em> <code>(</code> <em>parameter-declaration-clause</em> <code>)</code> <em>noexcept-specifier</em><sub><em>opt</em></sub> <em>attribute-specifier-seq</em><sub><em>opt</em></sub></p>
</blockquote>
<p>where the <em>ptr-declarator</em> consists solely of an <em>id-expression</em>, an optional <em>attribute-specifier-seq</em>, and optional surrounding parentheses, and the <em>id-expression</em> has one of the following forms:</p>
<ol style="list-style-type: decimal">
<li><u>in a friend declaration ([class.friend]), the <em>id-expression</em> is a <em>qualified-id</em> that names a constructor ([class.qual]);</u></li>
<li><u>otherwise, </u>in a <em>member-declaration</em> that belongs to the <em>member-specification</em> of a class or class template<s> but is not a friend declaration ([class.friend])</s>, the <em>id-expression</em> is the injected-class-name ([class.pre]) of the immediately-enclosing entity<s> or</s><u>;</u></li>
<li><s>in a declaration at namespace scope or in a friend declaration</s><u>otherwise</u>, the <em>id-expression</em> is a <em>qualified-id</em> <s>that names a constructor ([class.qual])</s><u>whose <em>unqualified-id</em> is the injected-class-name of its lookup context</u>.</li>
</ol>
<p>Constructors do not have names. In a constructor declaration, each <em>decl-specifier</em> in the optional <em>decl-specifier-seq</em> shall be <code>friend</code>, <code>inline</code>, <code>constexpr</code>, or an <em>explicit-specifier</em>. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 2:</p>
<blockquote>
<p>A constructor is used to initialize objects of its class type. <u>[<em>Note</em>: </u>Because constructors do not have names, they are never found during <u>unqualified </u>name lookup; however an explicit type conversion using the functional notation ([expr.type.conv]) will cause a constructor to be called to initialize an object. <s>[<em>Note</em>: </s>The syntax looks like an explicit call of the constructor. — <em>end note</em>] [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>] [<em>Note</em>: For initialization of objects of class type see [class.init]. — <em>end note</em>]</p>
</blockquote>
<h4 id="class.copy.assign">#[class.copy.assign]</h4>
<p>Change paragraph 8:</p>
<blockquote>
<p>Because a copy/move assignment operator is implicitly declared for a class if not declared by the user, a base class copy/move assignment operator is always hidden by the corresponding assignment operator of a derived class ([over.ass]). <u>[<em>Note</em>: </u>A <em>using-declaration</em><s> ([namespace.udecl])</s> that <s>brings in from a base class</s><u>names</u> an assignment operator with a parameter type that could be that of a copy/move assignment operator for <s>the</s><u>a</u> derived class <s>is not considered an explicit declaration of such an operator and </s>does not suppress the implicit declaration of the derived class operator<s>; the operator introduced by the <em>using-declaration</em> is hidden by the implicitly-declared operator in the derived class</s><u> ([namespace.udecl])</u>.<u> — _end note_]</u></p>
</blockquote>
<h4 id="class.dtor">#[class.dtor]</h4>
<p>Change paragraph 1:</p>
<blockquote>
<p>A <s><em>prospective destructor</em> is introduced by a </s>declaration whose <em>declarator<u>-id</u></em> <s>is</s><u>has an <em>unqualified-id</em> that begins with a <code>~</code> declares a <em>prospective destructor</em>; its <em>declarator</em> shall be</u> a function declarator ([dcl.fct]) of the form</p>
<blockquote>
<p><em>ptr-declarator</em> <code>(</code> <em>parameter-declaration-clause</em> <code>)</code> <em>noexcept-specifier</em><sub><em>opt</em></sub> <em>attribute-specifier-seq</em><sub><em>opt</em></sub></p>
</blockquote>
<p>where the <em>ptr-declarator</em> consists solely of an <em>id-expression</em>, an optional <em>attribute-specifier-seq</em>, and optional surrounding parentheses, and the <em>id-expression</em> has one of the following forms:</p>
<ol style="list-style-type: decimal">
<li>in a <em>member-declaration</em> that belongs to the <em>member-specification</em> of a class or class template but is not a friend declaration ([class.friend]), the <em>id-expression</em> is <code>~</code><em>class-name</em> and the <em>class-name</em> is the injected-class-name ([class.pre]) of the immediately-enclosing entity or</li>
<li><s>in a declaration at namespace scope or in a friend declaration</s><u>otherwise</u>, the <em>id-expression</em> is <em>nested-name-specifier</em> <code>~</code><em>class-name</em> and the <em>class-name</em> <s>names</s><u>is the injected-class-name of</u> the <s>same </s>class <s>as</s><u>nominated by</u> the <em>nested-name-specifier</em>.</li>
</ol>
<p>A prospective destructor shall take no arguments ([dcl.fct]). Each <em>decl-specifier</em> of the <em>decl-specifier-seq</em> of a prospective destructor declaration (if any) shall be <code>friend</code>, <code>inline</code>, <code>virtual</code>, <code>constexpr</code>, or <code>consteval</code>.</p>
</blockquote>
<p>Change paragraph 12:</p>
<blockquote>
<p>A prospective destructor can be declared <code>virtual</code> ([class.virtual]) or pure <code>virtual</code> ([class.abstract]). If the destructor of a class is virtual and any objects of that class or any derived class are created in the program, the destructor shall be defined. <s>If a class has a base class with a virtual destructor, its destructor (whether user- or implicitly-declared) is virtual.</s></p>
</blockquote>
<h4 id="class.conv">#[class.conv]</h4>
<p>Remove paragraph 5 (adapted in [class.conv.fct]):</p>
<div class="del">
<blockquote>
<p>User-defined conversions are used implicitly only if they are unambiguous. […]</p>
</blockquote>
</div>
<h5 id="class.conv.fct">#[class.conv.fct]</h5>
<p>Change paragraph 1:</p>
<blockquote>
<p>A member function of a class <code>X</code> <s>having no parameters </s>with a name of the form</p>
<blockquote>
<p><em>conversion-function-id</em>:</p>
<blockquote>
<p><code>operator</code> <em>conversion-type-id</em></p>
</blockquote>
<p><em>conversion-type-id</em>:</p>
<blockquote>
<p><em>type-specifier-seq</em> <em>conversion-declarator</em><sub><em>opt</em></sub></p>
</blockquote>
<p><em>conversion-declarator</em>:</p>
<blockquote>
<p><em>ptr-operator</em> <em>conversion-declarator</em><sub><em>opt</em></sub></p>
</blockquote>
</blockquote>
<p><u>shall have no parameters and </u>specifies a conversion from <code>X</code> to the type specified by the <em>conversion-type-id</em><u>, interpreted as a <em>type-id</em> ([dcl.name])</u>. […]</p>
</blockquote>
<p>Replace paragraph 4 with [class.conv]/5, with changes as marked:</p>
<div class="del">
<blockquote>
<p>Conversion functions are inherited.</p>
</blockquote>
</div>
<div class="mv">
<blockquote>
<p><s>User-defined conversions are used implicitly only if they are unambiguous.</s> <u>[<em>Note</em>: </u>A conversion function in a derived class <s>does not </s>hide<u>s only</u> <s>a </s>conversion function<u>s</u> in <s>a </s>base class<u>es</u> <s>unless the two functions</s><u>that</u> convert to the same type. <u>A conversion function template with a dependent return type hides only templates in base classes that correspond to it ([class.member.lookup]); otherwise, it hides and is hidden as a non-template function.</u> Function overload resolution ([over.match.best]) selects the best conversion function to perform the conversion.<u> — <em>end note</em>]</u> [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
</div>
<h4 id="class.static">#[class.static]</h4>
<p>Remove paragraph 2:</p>
<div class="del">
<blockquote>
<p>A static member may be referred to directly in the scope of its class or in the scope of a class derived ([class.derived]) from its class; […]</p>
</blockquote>
</div>
<h5 id="class.static.mfct">#[class.static.mfct]</h5>
<p>Change paragraph 2:</p>
<blockquote>
<p>[<em>Note</em>: A static member function does not have a <code>this</code> pointer ([<s>class</s><u>expr.prim</u>.this]).<s> — <em>end note</em>] A static member function shall not be <code>virtual</code>. There shall not be a static and a non-static member function with the same name and the same parameter types ([over.load]).</s> A static member function <s>shall not be declared</s><u>cannot be qualified with</u> <code>const</code>, <code>volatile</code>, or <s><code>const volatile</code></s><u><code>virtual</code></u>.<u> — <em>end note</em>]</u></p>
</blockquote>
<h5 id="class.static.data">#[class.static.data]</h5>
<p>Change paragraph 3:</p>
<blockquote>
<p>The declaration of a non-inline static data member in its class definition is not a definition and may be of an incomplete type other than <em>cv</em> <code>void</code>. <s>The definition for a static data member that is not defined inline in the class definition shall appear in a namespace scope enclosing the member’s class definition. In the definition at namespace scope, the name of the static data member shall be qualified by its class name using the <code>::</code> operator.</s> <u>[<em>Note</em>: </u>The <em>initializer</em><s> expression</s> in the definition of a static data member is in the scope of its class ([basic.scope.class]).<u> — <em>end note</em>]</u> [<em>Example</em>:</p>
<p>[…]</p>
<p>The <u>definition of the </u>static data member <code>run_chain</code> of class <code>process</code> <s>is defined in</s><u>inhabits the</u> global scope; the notation <code>process::run_chain</code> <s>specifies</s><u>indicates</u> that the member <code>run_chain</code> is a member of class <code>process</code> and in the scope of class <code>process</code>. In the static data member definition, the <em>initializer</em> expression refers to the static data member <code>running</code> of class <code>process</code>. — <em>end example</em>]</p>
<p>[<em>Note</em>: Once the static data member has been defined, it exists even if no objects of its class have been created. [<em>Example</em>: In the example above, <code>run_chain</code> and <code>running</code> exist even if no objects of class <code>process</code> are created by the program. — <em>end example</em>] <u>The initialization and destruction of static data members are described in [basic.start.static], [basic.start.dynamic], and [basic.start.term].</u> — <em>end note</em>]</p>
</blockquote>
<p>Change paragraph 4:</p>
<blockquote>
<p>[…] The member shall still be defined in a namespace scope if it is odr-used ([basic.def.odr]) in the program and the namespace scope definition shall not contain an <em>initializer</em>. <u>The declaration of a</u><s>A</s>n inline static data member <s>may be defined in the class</s><u>(which is a</u> definition<s> and</s><u>)</u> may specify a <em>brace-or-equal-initializer</em>. If the member is declared with the <code>constexpr</code> specifier, it may be redeclared in namespace scope with no initializer (this usage is deprecated; see [depr.static.constexpr]). Declarations of other static data members shall not specify a <em>brace-or-equal-initializer</em>.</p>
</blockquote>
<p>Remove paragraph 7 (re-expressed as the added note text above):</p>
<div class="del">
<blockquote>
<p>Static data members are initialized and destroyed exactly like non-local variables ([basic.start.static], [basic.start.dynamic], [basic.start.term]).</p>
</blockquote>
</div>
<h3 id="class.nest">#[class.nest]</h3>
<p>Change paragraph 1:</p>
<blockquote>
<p>A class can be declared within another class. A class declared within another is called a <em>nested class</em>. <s>The name of a nested class is local to its enclosing class. The nested class is in the scope of its enclosing class.</s> [<em>Note</em>: See [expr.prim.id] for restrictions on the use of non-static data members and non-static member functions. — <em>end note</em>]</p>
<p>[<em>Example</em>:</p>
[…]
<pre class="cpp">
inner* p = 0;                   // error: inner not <s>in scope</s><u>found</u>
</pre>

<p>— <em>end example</em>]</p>
</blockquote>
<p>Change and merge paragraphs 2 and 3:</p>
<blockquote>
<p><u>[<em>Note</em>: Nested classes can be defined either in the enclosing class or in an enclosing namespace; m</u><s>M</s>ember functions and static data members of a nested class can be defined <u>either in the nested class or </u>in a<u>n enclosing</u> namespace scope<s> enclosing the definition of their class</s>. [<em>Example</em>:</p>
<p>[…]</p>
<p><s>— <em>end example</em>]</p>
<p>If class <code>X</code> is defined in a namespace scope, a nested class <code>Y</code> may be declared in class <code>X</code> and later defined in the definition of class <code>X</code> or be later defined in a namespace scope enclosing the definition of class <code>X</code>. [<em>Example</em>:</s></p>
<p>[…]</p>
<p>— <em>end example</em>]<u> — <em>end note</em>]</u></p>
</blockquote>
<p>Change paragraph 4:</p>
<blockquote>
<p><s>Like a member function, a</s><u>A</u> friend function ([class.friend]) defined within a nested class <s>is in the lexical scope of that class; it obeys the same rules for name binding as a static member function of that class ([class.static]), but it </s>has no special access rights to members of an enclosing class.</p>
</blockquote>
<div class="del">
<h3>#[class.nested.type]</h3>
</div>
<p>Remove subclause, referring the stable name to [diff.basic]. Update the one cross reference (in [diff.class]/5) to refer to [class.member.lookup].</p>
<h3 id="class.union.anon">#[class.union.anon]</h3>
<p>Change paragraph 1:</p>
<blockquote>
<p>A union of the form</p>
<blockquote>
<p><code>union</code> <code>{</code> <em>member-specification</em> <code>}</code> <code>;</code></p>
</blockquote>
<p>is called an <em>anonymous union</em>; it defines an unnamed type and an unnamed object of that type called an <em>anonymous union <s>object</s><u>member</u></em><u> if it is a non-static data member or an <em>anonymous union variable</em> otherwise</u>. Each <em>member-declaration</em> in the <em>member-specification</em> of an anonymous union shall either define <s>a</s><u>one or more</u> non-static data member<u>s</u> or be a <em>static_assert-declaration</em>. Nested types, anonymous unions, and functions shall not be declared within an anonymous union. The names of the members of an anonymous union <s>shall be distinct from the names of any other entity</s><u>are bound</u> in the scope <s>in which</s><u>inhabited by</u> the <s>anonymous </s>union <s>is declared</s><u>declaration</u>. <s>For the purpose of name lookup, after the anonymous union definition, the members of the anonymous union are considered to have been defined in the scope in which the anonymous union is declared.</s> [<em>Example</em>:</p>
<p>[…]</p>
<p>Here <code>a</code> and <code>p</code> are used like ordinary (non-member) variables, but since they are union members they have the same address. — <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 2:</p>
<blockquote>
<p>Anonymous unions declared <s>in a named</s><u>in the scope of a</u> namespace <s>or in the global namespace</s><u>with external linkage</u> shall be declared <code>static</code>. Anonymous unions declared at block scope shall be declared with any storage class allowed for a block<s>-scope</s> variable, or with no storage class. A storage class is not allowed in a declaration of an anonymous union in a class scope. An anonymous union shall not have private or protected members ([class.access]). An anonymous union shall not have member functions.</p>
</blockquote>
<h3 id="class.local">#[class.local]</h3>
<p>Change paragraph 1:</p>
<blockquote>
<p>A class can be declared within a function definition; such a class is called a <em>local class</em>. <s>The name of a local class is local to its enclosing scope. The local class is in the scope of the enclosing scope, and has the same access to names outside the function as does the enclosing function.</s> [<em>Note</em>: […] — <em>end note</em>] [<em>Example</em>:</p>
[…]
<pre class="cpp">
local* p = 0;                   // error: local not <s>in scope</s><u>found</u>
</pre>

<p>— <em>end example</em>]</p>
</blockquote>
<h3 id="class.derived">#[class.derived]</h3>
<p>Change paragraph 2:</p>
<blockquote>
<p><u>The component names of a <em>class-or-decltype</em> are those of its <em>nested-name-specifier</em>, <em>type-name</em>, and/or <em>simple-template-id</em>.</u> A <em>class-or-decltype</em> shall denote a (possibly cv-qualified) class type that is not an incompletely defined class ([class.mem]); any cv-qualifiers are ignored. The class denoted by the <em>class-or-decltype</em> of a <em>base-specifier</em> is called a <em>direct base class</em> for the class being defined. <s>During t</s><u>T</u>he lookup for <s>a base class</s><u>the component</u> name<s>, non-type names are ignored</s><u> of the <em>type-name</em> or <em>simple-template-id</em> is type-only</u> ([basic.<s>scope.hiding</s><u>lookup</u>]). A class <code>B</code> is a base class of a class <code>D</code> if it is a direct base class of <code>D</code> or a direct base class of one of <code>D</code>’s base classes. A class is an <em>indirect base class</em> of another if it is a base class but not a direct base class. A class is said to be (directly or indirectly) <em>derived</em> from its (direct or indirect) base classes. [<em>Note</em>: See [class.access] for the meaning of <em>access-specifier</em>. — <em>end note</em>] <s>Unless redeclared in the derived class, members of a base class are also considered to be members of the derived class.</s> Members of a base class<s> other than constructors</s> are <s>said to be <em>inherited</em> by the</s><u>also members of the</u> derived class. <u>[<em>Note</em>:</u> Constructors of a base class can <s>also </s>be <u>explicitly </u>inherited<s> as described in</s> <u>(</u>[namespace.udecl]<u>)</u>. <s>Inherited</s><u>Base class</u> members can be referred to in expressions in the same manner as other members of the derived class, unless their names are hidden or ambiguous ([class.member.lookup]). <s>[<em>Note</em>: </s>The scope resolution operator <code>::</code> ([expr.prim.id.qual]) can be used to refer to a direct or indirect base member explicitly<s>. This allows access to a name that has been redeclared</s><u>, even if it is hidden</u> in the derived class. A derived class can itself serve as a base class subject to access control; see [class.access.base]. A pointer to a derived class can be implicitly converted to a pointer to an accessible unambiguous base class ([conv.ptr]). An lvalue of a derived class type can be bound to a reference to an accessible unambiguous base class ([dcl.init.ref]). — <em>end note</em>]</p>
</blockquote>
<h4 id="class.mi">#[class.mi]</h4>
<p>Change the note in paragraph 3:</p>
<blockquote>
<p>A class can be an indirect base class more than once and can be a direct and an indirect base class. There are limited things that can be done with such a class<s>. The</s><u>; lookup that finds its</u> non-static data members and member functions <s>of the direct base class cannot be referred to </s>in the scope of the derived class<u> will be ambiguous</u>. However, the static members, enumerations and types can be unambiguously referred to.</p>
</blockquote>
<h4 id="class.virtual">#[class.virtual]</h4>
<p>Change paragraph 1:</p>
<blockquote>
<p>A non-static member function is a <em>virtual function</em> if it is first declared with the keyword <code>virtual</code> or if it overrides a virtual member function declared in a base class (see below).<sup>[…]</sup> [<em>Note</em>: Virtual functions support dynamic binding and object-oriented programming. — <em>end note</em>] A class <s>that declares or inherits</s><u>with</u> a virtual<u> member</u> function is called a <em>polymorphic class</em>.<sup>[…]</sup></p>
</blockquote>
<p>Change paragraph 2:</p>
<blockquote>
<p>If a virtual member function <s><code>vf</code></s><u><em>F</em></u> is declared in a class <s><code>Base</code></s><u><em>B</em></u> and in a class <s><code>Derived</code>,</s><u><em>D</em></u> derived <u>(</u>directly or indirectly<u>)</u> from <s><code>Base</code>,</s><u><em>B</em> a declaration of</u> a member function <s><code>vf</code> with the same name, parameter-type-list ([dcl.fct]), cv-qualification, and ref-qualifier (or absence of same) as <code>Base::vf</code> is declared</s><u><em>G</em> that corresponds ([basic.scope.scope]) to a declaration of <em>F</em>, ignoring trailing <em>requires-clause</em>s</u>, then <s><code>Derived::vf</code></s><u><em>G</em></u> <em>overrides</em><sup>[…]</sup> <s><code>Base::vf</code></s><u><em>F</em></u>. For convenience we say that any virtual function overrides itself. A virtual member function <s><code>C::vf</code></s><u><em>V</em></u> of a class object <code>S</code> is a <em>final overrider</em> unless the most derived class ([intro.object]) of which <code>S</code> is a base class subobject (if any) <s>declares or inherits</s><u>has</u> another member function that overrides <s><code>vf</code></s><u><em>V</em></u>. […]</p>
</blockquote>
<p>Remove paragraph 7:</p>
<div class="del">
<blockquote>
<p>Even though destructors are not inherited, a destructor in a derived class overrides a base class destructor declared virtual; see [class.dtor] and [class.free].</p>
</blockquote>
</div>
<p>Change paragraph 9:</p>
<blockquote>
<p>If the class type in the covariant return type of <code>D::f</code> differs from that of <code>B::f</code>, the class type in the return type of <code>D::f</code> shall be complete at the <s>point</s><u>locus</u> of <u>the overriding </u>declaration<s> of <code>D::f</code></s> or shall be the class type <code>D</code>. When the overriding function is called as the final overrider of the overridden function, its result is converted to the type returned by the (statically chosen) overridden function ([expr.call]). [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<h4 id="class.abstract">#[class.abstract]</h4>
<p>Change paragraph 4:</p>
<blockquote>
<p>A class is abstract if it <s>contains or inherits</s><u>has</u> at least one pure virtual function for which the final overrider is pure virtual. [<em>Example</em>:</p>
<p>[…] — <em>end example</em>]</p>
</blockquote>
<h3 id="class.access">#[class.access]</h3>
<p>Change paragraph 1:</p>
<blockquote>
<p>A member of a class can be</p>
<ol style="list-style-type: decimal">
<li>private; that is, it<s>s name</s> can be <s>us</s><u>nam</u>ed only by members and friends of the class in which it is declared.</li>
<li>protected; that is, it<s>s name</s> can be <s>us</s><u>nam</u>ed only by members and friends of the class in which it is declared, by classes derived from that class, and by their friends (see [class.protected]).</li>
<li>public; that is, it<s>s name</s> can be <s>us</s><u>nam</u>ed anywhere without access restriction.</li>
</ol>
<p><u>[<em>Note</em>: A constructor or destructor can be named by an expression ([basic.def.odr]) even though it has no name. — <em>end note</em>]</u></p>
</blockquote>
<p>Change paragraph 2:</p>
<blockquote>
<p>A member of a class can also access all the <s>name</s><u>member</u>s to which the class has access. A local class of a member function may access the same <s>name</s><u>member</u>s that the member function itself may access.<sup>[…]</sup></p>
</blockquote>
<p>Change paragraph 4:</p>
<blockquote>
<p>Access control is applied uniformly to <s>all names, whether the names are referred to from </s>declarations <s>or</s><u>and</u> expressions. [<em>Note</em>: Access control applies to <s>names</s><u>members</u> nominated by friend declarations ([class.friend]) and <em>using-declaration</em>⁠s ([namespace.udecl]). — <em>end note</em>] <u>When a <em>using-declarator</em> is named, access control is applied to it, not to the declarations that replace it.</u> <s>In the case of overloaded function names</s><u>For an overload set</u>, access control is applied <u>only </u>to the function selected by overload resolution. [<em>Note</em>: Because access control applies to <s>names</s><u>the declarations named</u>, if access control is applied to a typedef name, only the accessibility of the typedef name itself is considered. The accessibility of the entity referred to by the typedef is not considered. For example,</p>
<p>[…]</p>
<p>— <em>end note</em>]</p>
</blockquote>
<p>Change paragraph 5:</p>
<blockquote>
<p>[<em>Note</em>: Access<s> to members and base classes is</s> control<s>led, not their visibility ([basic.scope.hiding]). Names of</s><u> does not prevent</u> members <s>are still visible, and</s><u>from being found by name lookup or</u> implicit conversions to base classes <s>are still</s><u>from being</u> considered<s>, when those members and base classes are inaccessible</s>. — <em>end note</em>] The interpretation of a given construct is established without regard to access control. If the interpretation established makes use of inaccessible member<s> name</s>s or base classes, the construct is ill-formed.</p>
</blockquote>
<p>Change paragraph 6:</p>
<blockquote>
<p>All access controls in [class.access] affect the ability to <s>access</s><u>name</u> a class member<s> name</s> from the declaration of a particular entity, including parts of the declaration preceding the name of the entity being declared and, if the entity is a class, the definitions of members of the class appearing outside the class’s <em>member-specification</em>. [<em>Note</em>: This access also applies to implicit references to constructors, conversion functions, and destructors. — <em>end note</em>]</p>
</blockquote>
<p>Change paragraph 8:</p>
<blockquote>
<p><s>The names in</s><u>Access is checked for</u> a default argument ([dcl.fct.default]) <s>are bound </s>at the point of declaration<s>, and access is checked at that point </s>rather than at any points of use of the default argument. Access checking for default arguments in function templates and in member functions of class templates is performed as described in [temp.inst].</p>
</blockquote>
<p>Change paragraph 9:</p>
<blockquote>
<p><s>The names in</s><u>Access for</u> a default <em>template-argument</em> ([temp.param]) <s>have their access</s><u>is</u> checked in the context in which <s>they</s><u>it</u> appear<u>s</u> rather than at any points of use of <s>the default <em>template-argument</em></s><u>it</u>. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<h4 id="class.access.base">#[class.access.base]</h4>
<p>Change paragraph 3:</p>
<blockquote>
<p>[<em>Note</em>: A member of a private base class might be inaccessible as <s>an </s>inherited<s> member name</s>, but accessible directly. […]</p>
<p>— <em>end note</em>]</p>
</blockquote>
<p>Change paragraph 5:</p>
<blockquote>
<p>[…] The access to a member is affected by the class in which the member is named. This naming class is the class in <s>which the member name was looked up and found</s><u>whose scope name lookup performed a search that found the member</u>. […]</p>
</blockquote>
<h4 id="class.friend">#[class.friend]</h4>
<p>Change paragraph 1:</p>
<blockquote>
<p>A friend of a class is a function or class that is given permission to <s>use</s><u>name</u> the private and protected member<s> names from</s><u>s of</u> the class. […]</p>
</blockquote>
<p>Change paragraph 2:</p>
<blockquote>
<p>Declaring a class to be a friend implies that <s>the names of </s>private and protected members <s>from</s><u>of</u> the class granting friendship can be <s>accessed</s><u>named</u> in the <em>base-specifier</em>⁠s and member declarations of the befriended class. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>] [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
<p><s>A class shall not be defined in a friend declaration. [<em>Example</em>:</s></p>
<p><s>[…]</s></p>
<p><s>— <em>end example</em>]</s></p>
</blockquote>
<p>Change the example in paragraph 3:</p>
<blockquote>
[…]
<pre class="cpp">
  friend D;                     // error: <s>no type-name </s>D <s>in scope</s><u>not found</u>
</pre>
<p>[…]</p>
</blockquote>
<p>Change paragraph 5:</p>
<blockquote>
<p><s>When a</s><u>[<em>Note</em>: A</u> friend declaration refers to an <s>overloaded</s><u>entity, not (all overloads of) a</u> name<s> or operator, only the function specified by the parameter types becomes a friend</s>. A member function of a class <code>X</code> can be a friend of a class <code>Y</code>. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]<u> — <em>end note</em>]</u></p>
</blockquote>
<p>Change paragraph 6:</p>
<blockquote>
<p>A function <s>can</s><u>may</u> be defined in a friend declaration of a class if and only if the class is a non-local class ([class.local])<s>,</s><u> and</u> the function name is unqualified<s>, and the function has namespace scope</s>. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 7:</p>
<blockquote>
<p>Such a function is implicitly an inline ([dcl.inline]) function if it is attached to the global module. <s>A friend function defined in a class is in the (lexical) scope of the class in which it is defined.</s> <u>[<em>Note</em>: If a</u><s>A</s> friend function <u>is </u>defined outside <s>the</s><u>a</u> class<u>, it</u> is not<u> in the scope of the class</u><s> ([basic.lookup.unqual])</s>.<u>— <em>end note</em>]</u></p>
</blockquote>
<p>Change paragraph 9:</p>
<blockquote>
<p>A <s>name</s><u>member</u> nominated by a friend declaration shall be accessible in <s>the scope of </s>the class containing the friend declaration. The meaning of the friend declaration is the same whether the friend declaration appears in the private, protected, or public ([class.mem]) portion of the class <em>member-specification</em>.</p>
</blockquote>
<p>Replace paragraph 11, adding the example from [namespace.memdef]/3 and then retaining its example:</p>
<div class="del">
<blockquote>
<p>If a friend declaration appears in a local class ([class.local]) and the name specified is an unqualified name, […]</p>
</blockquote>
</div>
<div class="ins">
<blockquote>
<p>[<em>Note</em>: A friend declaration never binds any names ([dcl.meaning], [dcl.type.elab]). — <em>end note</em>] <span class="mv">[<em>Example</em>:</span></p>
<p><span class="mv">[… from [namespace.memdef]/2]</span></p>
<p><span class="mv">— <em>end example</em>]</span> [<em>Example</em>:</p>
<p>[… from [class.friend]/11]</p>
<p>— <em>end example</em>]</p>
</blockquote>
</div>
<h4 id="class.paths">#[class.paths]</h4>
<p>Change paragraph 1:</p>
<blockquote>
<p>If a <s>name</s><u>declaration</u> can be reached by several paths through a multiple inheritance graph, the access is that of the path that gives most access. [<em>Example</em>:</p>
<p>[…] — <em>end example</em>]</p>
</blockquote>
<h3 id="class.init">#[class.init]</h3>
<h4 id="class.base.init">#[class.base.init]</h4>
<p>Change paragraph 2:</p>
<blockquote>
<p><s>In</s><u>Lookup for an unqualified name in</u> a <em>mem-initializer-id</em> <s>an initial unqualified <em>identifier</em> is looked up in the scope of the constructor’s class and, if not found in that scope, it is looked up in the scope containing the constructor’s definition</s><u>ignores the constructor’s function parameter scope</u>.<!-- remote --> [<em>Note</em>: If the constructor’s class contains a member with the same name as a direct or virtual base class of the class, a <em>mem-initializer-id</em> naming the member or base class and composed of a single identifier refers to the class member. A <em>mem-initializer-id</em> for the hidden base class may be specified using a qualified name. — <em>end note</em>] Unless the <em>mem-initializer-id</em> names the constructor’s class, a non-static data member of the constructor’s class, or a direct or virtual base of that class, the <em>mem-initializer</em> is ill-formed.</p>
</blockquote>
<p>Change paragraph 4:</p>
<blockquote>
<p>If a <em>mem-initializer-id</em> is ambiguous because it designates both a direct non-virtual base class and an <s>inherited</s><u>indirect</u> virtual base class, the <em>mem-initializer</em> is ill-formed. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 15:</p>
<blockquote>
<p><s>Names in t</s><u>[<em>Note</em>: T</u>he <em>expression-list</em> or <em>braced-init-list</em> of a <em>mem-initializer</em> <s>are evaluated</s><u>is</u> in the <u>function parameter </u>scope of the constructor <s>for which the <em>mem-initializer</em> is specified.</s><u>and can use <code>this</code> to refer to the object being initialized. — <em>end note</em>]</u> [<em>Example</em>:</p>
<p>[…]</p>
<p>initializes <code>X::r</code> to refer to <code>X::a</code>, initializes <code>X::b</code> with the value of the constructor parameter <code>i</code>, initializes <code>X::i</code> with the value of the constructor parameter <code>i</code>, and initializes <code>X::j</code> with the value of <code>X::i</code>; this takes place each time an object of class <code>X</code> is created. — <em>end example</em>] <s>[<em>Note</em>: Because the <em>mem-initializer</em> are evaluated in the scope of the constructor, the <code>this</code> pointer can be used in the <em>expression-list</em> of a <em>mem-initializer</em> to refer to the object being initialized. — <em>end note</em>]</s></p>
</blockquote>
<h4 id="class.copy.elision">#[class.copy.elision]</h4>
<p>Change bullet (1.2):</p>
<blockquote>
<p>in a <em>throw-expression</em> ([expr.throw]), when the operand is the name of a non-volatile object with automatic storage duration (other than a function or catch-clause parameter) <s>whose</s><u>that belongs to a</u> scope <u>that </u>does not <s>extend beyond the end of</s><u>contain</u> the innermost enclosing <u><em>compound-statement</em> associated with a </u><em>try-block</em> (if there is one), the copy/move operation can be omitted by constructing the object directly into the exception object<!-- FIXME: this transcends lambdas (preexisting, here and in /3.2) --></p>
</blockquote>
<p>Change paragraph 2:</p>
<blockquote>
<p>[<em>Example</em>:</p>
<p>[…]</p>
<p>Here the criteria for elision can eliminate the copying of the object <code>t</code> with automatic storage duration into the result object for the function call <code>f()</code>, which is the <s>global</s><u>non-local</u> object <code>t2</code>. Effectively, the construction of <s>the local object </s><code>t</code> can be viewed as directly initializing <s>the global object </s><code>t2</code>, and that object’s destruction will occur at program exit. Adding a move constructor to <code>Thing</code> has the same effect, but it is the move construction from the object with automatic storage duration to <code>t2</code> that is elided. — <em>end example</em>]</p>
</blockquote>
<p>Change bullet (3.2):</p>
<blockquote>
<p>if the operand of a <em>throw-expression</em> ([expr.throw]) is a (possibly parenthesized) <em>id-expression</em> that names an implicitly movable entity <s>whose</s><u>that belongs to a</u> scope <u>that </u>does not <s>extend beyond</s><u>contain</u> the <em>compound-statement</em> of the innermost <em>try-block</em> or <em>function-try-block</em> (if any) whose <em>compound-statement</em> or <em>ctor-initializer</em> <s>encloses</s><u>contains</u> the <em>throw-expression</em>,</p>
</blockquote>
<h2 id="class.free">#[class.free]</h2>
<p>Remove paragraph 3:</p>
<div class="del">
<blockquote>
<p>When an object is deleted with a <em>delete-expression</em> ([expr.delete]), […]</p>
</blockquote>
</div>
<p>Remove paragraph 4, part of which is incorporated in [expr.delete]:</p>
<div class="del">
<blockquote>
<p>Class-specific deallocation function lookup is a part of general deallocation function lookup ([expr.delete]) and occurs as follows. […]</p>
</blockquote>
</div>
<p>Change paragraph 6:</p>
<blockquote>
<p>Since member allocation and deallocation functions are <code>static</code> they cannot be virtual. [<em>Note</em>: However, when the <em>cast-expression</em> of a <em>delete-expression</em> refers to an object of class type<u> with a virtual destructor</u>, because the deallocation function<s> actually called</s> is <s>looked up in the scope of the class that is the dynamic type of the object if</s><u>chosen by</u> the destructor <s>is virtual</s><u>of the dynamic type of the object</u>, the effect is the same in that case. […] — <em>end note</em>] [<em>Note</em>: […]</p>
<p>— <em>end note</em>]</p>
</blockquote>
<p>Change paragraph 7:</p>
<blockquote>
<p>Access to the deallocation function is checked statically<s>. Hence</s>, even though a different one might actually be executed<s>, the statically visible deallocation function is required to be accessible</s>. [<em>Example</em>: For the call on line “// 1” above, if <code>B::operator delete()</code> had been private, the delete expression would have been ill-formed. — <em>end example</em>]</p>
</blockquote>
<h2 id="over">#[over]</h2>
<h3 id="over.pre">#[over.pre]</h3>
<p>Change paragraph 1:</p>
<div class="del">
<blockquote>
<p><s>When</s><u>[<em>Note</em>: Each of</u> two or more <s>different declarations are specified for a single</s><u>entities with the same</u> name in the same scope, <s>that name is said to be <em>overloaded</em>, and the declarations are called <em>overloaded declarations</em>. Only</s><u>which must be</u> function<u>s</u> <s>and</s><u>or</u> function template<u>s</u><s> declarations can be overloaded; variable and type declarations cannot be overloaded</s><u>, is commonly called an “overload”</u>.<u> — <em>end note</em>]</u></p>
</blockquote>
</div>
<p>Change paragraph 2:</p>
<blockquote>
<p>When a function <s>name </s>is <s>us</s><u>nam</u>ed in a call, which function declaration is being referenced and the validity of the call are determined by comparing the types of the arguments at the point of use with the types of the parameters in the declarations <s>that are visible at the point of use</s><u>in the overload set</u>. This function selection process is called <em>overload resolution</em> and is defined in [over.match]. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<div class="del">
<h3>#[over.load]</h3>
</div>
<p>Remove subclause, referring the stable name to [basic.scope.scope]. Update the surviving cross reference (in [class.mem]/5) to refer to [basic.scope.scope].</p>
<p>Parts of the notes and examples are adapted in [basic.scope.scope]/3 and [dcl.fct]/5.</p>
<div class="del">
<h3>#[over.dcl]</h3>
</div>
<p>Remove subclause, referring the stable name (which has no cross references) to [basic.link].</p>
<p>The first example in paragraph 1 is moved to [temp.over.link]/5.</p>
<h3 id="over.match">#[over.match]</h3>
<h4 id="over.match.funcs">#[over.match.funcs]</h4>
<p>Change paragraph 4:</p>
<blockquote>
<p>[…] For conversion functions, the function is considered to be a member of the class of the implied object argument for the purpose of defining the type of the implicit object parameter. For non-conversion functions <s>introduced</s><u>nominated</u> by a <em>using-declaration</em> in<s>to</s> a derived class, the function is considered to be a member of the derived class for the purpose of defining the type of the implicit object parameter. […]</p>
</blockquote>
<p>Insert before paragraph 7:</p>
<div class="ins">
<blockquote>
<p>In each case where conversion functions of a class <code>S</code> are considered for initializing an object or reference of type <code>T</code>, the candidate functions include the result of a search for the <em>conversion-function-id</em> <code>operator T</code> in <code>S</code>. [<em>Note</em>: This search may find a specialization of a conversion function template ([basic.lookup]). — <em>end note</em>] Each such case also defines sets of <em>permissible types</em> for explicit and non-explicit conversion functions; each (non-template) conversion function that is a non-hidden member of <code>S</code>, yields a permissible type, and, for the former set, is non-explicit is also a candidate function. If initializing an object, for any permissible type <em>cv</em> <code>U</code>, any <em>cv2</em> <code>U</code>, <em>cv2</em> <code>U&amp;</code>, or <em>cv2</em> <code>U&amp;&amp;</code> is also a permissible type. If the set of permissible types for explicit conversion functions is empty, any candidates that are explicit are discarded.</p>
</blockquote>
</div>
<p>Change paragraph 7:</p>
<blockquote>
<p>In each case where a candidate is a function template, candidate function template specializations are generated using template argument deduction ([temp.over], [temp.deduct]). If a constructor template or conversion function template has an <em>explicit-specifier</em> whose <em>constant-expression</em> is value-dependent ([temp.dep]), template argument deduction is performed first and then, if the context <s>requires a</s><u>admits only</u> candidate<u>s</u> that <s>is</s><u>are</u> not explicit and the generated specialization is explicit ([dcl.fct.spec]), it will be removed from the candidate set. Those candidates are then handled as candidate functions in the usual way.<sup>[…]</sup> A given name can refer to<u>, or a conversion can consider,</u> one or more function templates <s>and also to</s><u>as well as</u> a set of non-template functions. In such a case, the candidate functions generated from each function template are combined with the set of non-template candidate functions.</p>
</blockquote>
<h5 id="over.call.func">#[over.call.func]</h5>
<p>Change paragraph 1:</p>
<blockquote>
<p>Of interest in [over.call.func] are only those function calls in which the <em>postfix-expression</em> ultimately contains a<u>n <em>id-expression</em></u><s> name</s> that denotes one or more functions that might be called. […]</p>
</blockquote>
<p>Change paragraph 2:</p>
<blockquote>
<p>In qualified function calls, the <s>name to be resolved</s><u>function</u> is <u>named by </u>an <em>id-expression</em> <s>and is </s>preceded by an <code>-&gt;</code> or <code>.</code> operator. Since the construct <code>A-&gt;B</code> is generally equivalent to <code>(*A).B</code>, the rest of [over] assumes, without loss of generality, that all member function calls have been normalized to the form that uses an object and the <code>.</code> operator. Furthermore, [over] assumes that the <em>postfix-expression</em> that is the left operand of the <code>.</code> operator has type “<em>cv</em> <code>T</code>” where <code>T</code> denotes a class.<sup>[…]</sup> <s>Under this assumption, the <em>id-expression</em> in the call is looked up as a member function of <code>T</code> following the rules for looking up names in classes ([class.member.lookup]).</s> The function declarations found by <s>that</s><u>name</u> lookup<u> ([class.member.lookup])</u> constitute the set of candidate functions. The argument list is the <em>expression-list</em> in the call augmented by the addition of the left operand of the <code>.</code> operator in the normalized member function call as the implied object argument ([over.match.funcs]).</p>
</blockquote>
<p>Change paragraph 3:</p>
<blockquote>
<p>In unqualified function calls, the <u>function is </u>name<u>d</u> <s>is not qualified </s>by<s> an <code>-&gt;</code> or <code>.</code> operator and has the more general form of</s> a <em>primary-expression</em>. <s>The name is looked up in the context of the function call following the normal rules for name lookup in expressions ([basic.lookup]).</s> The function declarations found by <s>that</s><u>name</u> lookup<u> ([basic.lookup])</u> constitute the set of candidate functions. Because of the rules for name lookup, the set of candidate functions consists (1) entirely of non-member functions or (2) entirely of member functions of some class <code>T</code>. In case (1), the argument list is the same as the <em>expression-list</em> in the call. In case (2), the argument list is the <em>expression-list</em> in the call augmented by the addition of an implied object argument as in a qualified function call. If <u>the current class is, or is derived, from <code>T</code> and </u>the keyword <code>this</code> ([<s>class</s><u>expr.prim</u>.this]) <s>is in scope and </s>refers to <s>class <code>T</code>, or a derived class of <code>T</code></s><u>it</u>, then the implied object argument is <code>(*this)</code>. <s>If the keyword <code>this</code> is not in scope or refers to another class, then</s><u>Otherwise,</u> a contrived object of type <code>T</code> becomes the implied object argument<s>.</s><sup>[…]</sup><u>;</u> <s>If the argument list is augmented by a contrived object and</s><u>if</u> overload resolution selects <s>one of the</s><u>a</u> non-static member function<s>s of <code>T</code></s>, the call is ill-formed.</p>
</blockquote>
<h5 id="over.call.object">#[over.call.object]</h5>
<p>Change paragraph 1:</p>
<blockquote>
<p>If the <em>postfix-expression</em> <code>E</code> in the function call syntax evaluates to a class object of type “<em>cv</em> <code>T</code>”, then the set of candidate functions includes at least the function call operators of <code>T</code>. The function call operators of <code>T</code> are <s>obtained by ordinary lookup</s><u>the results</u> of <u>a search for </u>the name <code>operator()</code> in the <s>context</s><u>scope</u> of <s><code>(E).operator()</code></s><u><code>T</code></u>.</p>
</blockquote>
<h5 id="over.match.oper">#[over.match.oper]</h5>
<p>Change bullet (3.1):</p>
<blockquote>
<p>If <code>T1</code> is a complete class type or a class currently being defined, the set of member candidates is the result of <s>the qualified lookup of</s><u>a search for</u> <code><s>T1::</s>operator@</code><s> ([over.call.func])</s><u> in the scope of <code>T1</code></u>; otherwise, the set of member candidates is empty.</p>
</blockquote>
<p>Change bullet (3.2):</p>
<blockquote>
<p><s>The</s><u>For the operators <code>=</code>, <code>[]</code>, or <code>-&gt;</code>, the</u> set of non-member candidates is<u> empty; otherwise, it includes</u> the result of <s>the </s>unqualified lookup <s>of</s><u>for</u> <code>operator@</code> <s>in the context of the expression according to the usual rules for name lookup in unqualified</s><u>in the rewritten</u> function call<s>s</s> (<u>[basic.lookup.unqual], </u>[basic.lookup.argdep])<s> except that</s><u>, ignoring</u> all member functions<s> are ignored</s>. However, if no operand has a class type, only those non-member functions in the lookup set that have a first parameter of type <code>T1</code> or “reference to <em>cv</em> <code>T1</code>”, when <code>T1</code> is an enumeration type, or (if there is a right operand) a second parameter of type <code>T2</code> or “reference to <em>cv</em> <code>T2</code>”, when <code>T2</code> is an enumeration type, are candidate functions.</p>
</blockquote>
<h5 id="over.match.copy">#[over.match.copy]</h5>
<p>Change bullet (1.2):</p>
<blockquote>
<p>When the type of the initializer expression is a class type “<em>cv</em> <code>S</code>”, <s>the non-explicit </s>conversion functions<s> of <code>S</code> and its base classes</s> are considered. <u>The permissible types for non-explicit conversion functions are <code>T</code> and any class derived from <code>T</code>.</u> When initializing a temporary object ([class.mem]) to be bound to the first parameter of a constructor where the parameter is of type “reference to <em>cv2</em> <code>T</code>” and the constructor is called with a single argument in the context of direct-initialization of an object of type “<em>cv3</em> <code>T</code>”, <u>the permissible types for </u>explicit conversion functions are <s>also considered</s><u>the same; otherwise there are none</u>. <s>Those that are not hidden within <code>S</code> and yield a type whose cv-unqualified version is the same type as <code>T</code> or is a derived class thereof are candidate functions. A call to a conversion function returning “reference to <code>X</code>” is a glvalue of type <code>X</code>, and such a conversion function is therefore considered to yield <code>X</code> for this process of selecting candidate functions.</s></p>
</blockquote>
<h5 id="over.match.conv">#[over.match.conv]</h5>
<p>Change paragraph 1:</p>
<blockquote>
<p>Under the conditions specified in [dcl.init], as part of an initialization of an object of non-class type, a conversion function can be invoked to convert an initializer expression of class type to the type of the object being initialized. Overload resolution is used to select the conversion function to be invoked. Assuming that “<em>cv<s>1</s></em> <code>T</code>” is the type of the object being initialized<s>, and “<em>cv</em> <code>S</code>” is the type of the initializer expression, with <code>S</code> a class type</s>, the candidate functions are selected as follows:</p>
<ol style="list-style-type: decimal">
<li>The <s>conversion functions of <code>S</code> and its base classes are considered. Those</s><u>permissible types for</u> non-explicit conversion functions <s>that </s>are <s>not hidden within <code>S</code> and yield type <code>T</code> or a type</s><u>those</u> that can be converted to type <code>T</code> via a standard conversion sequence ([over.ics.scs])<s> are candidate functions</s>. For direct-initialization, <s>those</s><u>the permissible types for</u> explicit conversion functions <s>that </s>are <s>not hidden within <code>S</code> and yield type <code>T</code> or a type</s><u>those</u> that can be converted to type <code>T</code> with a <u>(possibly trivial) </u>qualification conversion ([conv.qual])<s> are also candidate functions</s><u>; otherwise there are none</u>. <s>Conversion functions that return a cv-qualified type are considered to yield the cv-unqualified version of that type for this process of selecting candidate functions. A call to a conversion function returning “reference to <code>X</code>” is a glvalue of type <code>X</code>, and such a conversion function is therefore considered to yield <code>X</code> for this process of selecting candidate functions.</s></li>
</ol>
</blockquote>
<h5 id="over.match.ref">#[over.match.ref]</h5>
<p>Change paragraph 1:</p>
<blockquote>
<p>Under the conditions specified in [dcl.init.ref], a reference can be bound directly to the result of applying a conversion function to an initializer expression. Overload resolution is used to select the conversion function to be invoked. Assuming that “reference to <em>cv1</em> <code>T</code>” is the type of the reference being initialized<s>, and “<em>cv</em> <code>S</code>” is the type of the initializer expression, with <code>S</code> a class type</s>, the candidate functions are selected as follows:</p>
<ol style="list-style-type: decimal">
<li><s>The conversion functions of <code>S</code> and its base classes are considered. Those non-explicit conversion functions that are not hidden within <code>S</code> and yield</s><u>Let <em>R</em> be a set of</u> type<u>s including</u> “lvalue reference to <em>cv2</em> <code>T2</code>” (when initializing an lvalue reference or an rvalue reference to function) <s>or</s><u>and</u> “<em>cv2</em> <code>T2</code>” <s>or</s><u>and</u> “rvalue reference to <em>cv2</em> <code>T2</code>” (when initializing an rvalue reference or an lvalue reference to function)<s>,</s><u> for any <code>T2</code>. The permissible types for non-explicit conversion functions are the members of <em>R</em></u> where “<em>cv1</em> <code>T</code>” is reference-compatible ([dcl.init.ref]) with “<em>cv2</em> <code>T2</code>”<s>, are candidate functions</s>. For direct-initialization, <s>those</s><u>the permissible types for</u> explicit conversion functions <s>that </s>are <s>not hidden within <code>S</code> and yield type “lvalue reference to <em>cv2</em> <code>T2</code>” (when initializing an lvalue reference or an rvalue reference to function) or “rvalue reference to <em>cv2</em> <code>T2</code>” (when initializing an rvalue reference or an lvalue reference to function),</s><u>the members of <em>R</em></u> where <code>T2</code> <s>is the same type as <code>T</code> or </s>can be converted to type <code>T</code> with a <u>(possibly trivial) </u>qualification conversion ([conv.qual])<s>, are also candidate functions</s><u>; otherwise there are none</u>.</li>
</ol>
</blockquote>
<h4 id="over.match.best">#[over.match.best]</h4>
<p>Change paragraph 4:</p>
<blockquote>
<p>If the best viable function resolves to a function for which multiple declarations were found, and if <s>at least</s><u>any</u> two of these declarations <s>— or the declarations they refer to in the case of <em>using-declaration</em>⁠s —</s><u>inhabit different scopes and</u> specify a default argument that made the function viable, the program is ill-formed. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<h3 id="address-of-an-overloaded-function-set-over.over">Address of <u>an </u>overload<s>ed function</s><u> set</u> #[over.over]</h3>
<p>Change the name of the subclause.</p>
<p>Change paragraph 1:</p>
<blockquote>
<p><s>A use of a function name</s><u>An <em>id-expression</em> whose terminal name refers to an overload set <em>S</em> and that appears</u> without arguments is resolved to a function, a pointer to function, or a pointer to member function for a specific function that is chosen from a set of <s>selected </s>functions<u> selected from <em>S</em></u> determined based on the target type required in the context (if any), as described below. The target can be</p>
<ol style="list-style-type: decimal">
<li>an object or reference being initialized ([dcl.init], [dcl.init.ref], [dcl.init.list]),</li>
<li>the left side of an assignment ([expr.ass]),</li>
<li>a parameter of a function ([expr.call]),</li>
<li>a parameter of a user-defined operator ([over.oper]),</li>
<li>the return value of a function, operator function, or conversion ([stmt.return]),</li>
<li>an explicit type conversion ([expr.type.conv], [expr.static.cast], [expr.cast]), or</li>
<li>a non-type <em>template-parameter</em> ([temp.arg.nontype]).</li>
</ol>
<p>The <s>function name</s><u><em>id-expression</em></u> can be preceded by the <code>&amp;</code> operator. [<em>Note</em>: Any redundant set of parentheses surrounding the function name is ignored ([expr.prim.paren]). — <em>end note</em>]</p>
</blockquote>
<p>Change paragraph 3:</p>
<blockquote>
<p><s>For each function template designated by the name,</s><u>The specialization, if any, generated by</u> template argument deduction<s> is done</s> (<u>[temp.over], </u>[temp.deduct.funcaddr]<u>, [temp.arg.explicit]</u>)<s>, and if the argument deduction succeeds, the resulting template argument list is used to generate a single</s><u> for each</u> function template <s>specialization, which</s><u>named</u> is added to the set of selected functions considered. <s>[<em>Note</em>: […] — <em>end note</em>]</s></p>
</blockquote>
<p>Change paragraph 4:</p>
<blockquote>
<p>Non-member functions and static member functions match targets of function pointer type or reference to function type. Non-static member functions match targets of pointer-to-member-function type. <u>[<em>Note</em>: </u>If a non-static member function is <s>selected</s><u>chosen</u>, the <s>reference to the overloaded function name is required to have the form of</s><u>result can be used only to form</u> a pointer to member<s> as described in</s> <u>(</u>[expr.unary.op]<u>)</u>.<u> — <em>end note</em>]</u></p>
</blockquote>
<p>Change paragraph 7:</p>
<blockquote>
<p>[<em>Note</em>: If <code>f<s>()</s></code> and <code>g<s>()</s></code> are both overload<s>ed functions</s><u> sets</u>, the cross product of possibilities must be considered to resolve <code>f(&amp;g)</code>, or the equivalent expression <code>f(g)</code>. — <em>end note</em>]</p>
</blockquote>
<h3 id="over.oper">#[over.oper]</h3>
<p>Change paragraph 1:</p>
<blockquote>
<p>A <s>function </s>declaration <s>having one of the following</s><u>whose <em>declarator-id</em> is an</u> <em>operator-function-id</em><s>s as its name</s><u> shall</u> declare<s>s</s><u>a function or function template or an explicit instantiation or specialization of a function template.</u> <u>A function so declared is</u> an <em>operator function</em>. A function template <s>declaration having one of the following <em>operator-function-id</em>s as its name declares</s><u>so declared is</u> an <em>operator function template</em>. A specialization of an operator function template is also an operator function. An operator function is said to <em>implement</em> the operator named in its <em>operator-function-id</em>.</p>
</blockquote>
<h4 id="over.unary">#[over.unary]</h4>
<p>Change paragraph 2:</p>
<blockquote>
<p><u>[<em>Note</em>: </u>The unary and binary forms of the same operator <s>are considered to </s>have the same name. <s>[<em>Note</em>: </s>Consequently, a unary operator can hide a binary operator from an enclosing scope, and vice versa. — <em>end note</em>]</p>
</blockquote>
<h3 id="over.literal">#[over.literal]</h3>
<p>Change paragraph 2:</p>
<blockquote>
<p>A declaration whose <em>declarator-id</em> is a <em>literal-operator-id</em> shall <s>be a declaration of</s><u>declare</u> a <s>namespace-scope </s>function or function template<u> that belongs to a namespace</u> (it could be a friend function ([class.friend]))<s>,</s><u> or</u> an explicit instantiation or specialization of a function template<s>, or a <em>using-declaration</em> ([namespace.udecl])</s>. A function declared with a <em>literal-operator-id</em> is a <em>literal operator</em>. A function template declared with a <em>literal-operator-id</em> is a <em>literal operator template</em>.</p>
</blockquote>
<h2 id="temp">#[temp]</h2>
<h3 id="temp.pre">#[temp.pre]</h3>
<p>Change paragraph 4:</p>
<blockquote>
<p><u>[<em>Note</em>: </u>A <em>template-declaration</em> can appear only as a namespace scope or class scope declaration.<u> — <em>end note</em>]</u> Its <em>declaration</em> shall not be an <em>export-declaration</em>. In a function template declaration, the <s>last component</s><u><em>unqualified-id</em></u> of the <em>declarator-id</em> shall <s>not </s>be a <s><em>template-id</em></s><u>name</u>. [<em>Note</em>: <s>That last component may be an <em>identifier</em>, an <em>operator-function-id</em>, a <em>conversion-function-id</em>, or a <em>literal-operator-id</em>.</s> In a class template declaration, if the <s>class name</s><u><em>class-name</em></u> is a <em>simple-template-id</em>, the declaration declares a class template partial specialization ([temp.class.spec]). — <em>end note</em>]</p>
</blockquote>
<p>Change paragraph 6:</p>
<blockquote>
<p><s>A template name has linkage ([basic.link]).</s> <u>A s</u><s>S</s>pecialization<s>s</s> (explicit or implicit) of <s>a</s><u>one</u> template <s>that has internal linkage are</s><u>is</u> distinct from all specializations <s>in</s><u>of any</u> other <s>translation units</s><u>template</u>. A template, a template explicit specialization ([temp.expl.spec]), and a class template partial specialization shall not have C linkage. <s>Use of a linkage specification other than <code>&quot;C&quot;</code> or <code>&quot;C++&quot;</code> with any of these constructs is conditionally-supported, with implementation-defined semantics. Template definitions shall obey the one-definition rule ([basic.def.odr]).</s> [<em>Note</em>: Default arguments for function templates and for member functions of class templates are considered definitions for the purpose of template instantiation ([temp.decls]) and must<s> also</s> obey the one-definition rule<u> ([basic.def.odr])</u>. — <em>end note</em>]</p>
</blockquote>
<p>Change paragraph 7:</p>
<blockquote>
<p><u>[<em>Note</em>: </u>A <s>class </s>template <s>shall </s><u>can</u>not have the same name as any other <s>template, class, function, variable, enumeration, enumerator, namespace, or type</s><u>name bound</u> in the same scope ([basic.scope<u>.scope</u>]), except <s>as specified in [temp.class.spec]. Except </s>that a function template can <s>be overloaded either by</s><u>share a name with</u> non-template functions ([dcl.fct]) <s>with the same name or by other</s><u>and/or</u> function templates<s> with the same name</s> ([temp.over])<s>, a template name declared in namespace scope or in class scope shall be unique in that scope</s>. <u>Specializations, including partial specializations ([temp.class.spec]), do not reintroduce or bind names. Their target scope is the target scope of the primary template, so all specializations of a template belong to the same scope as it does. — <em>end note</em>]</u></p>
</blockquote>
<p>Change paragraph 8:</p>
<blockquote>
<p>[<em>Note</em>: A local class, a local<u> or block</u> variable, or a friend function defined in a templated entity is a templated entity. — <em>end note</em>]</p>
</blockquote>
<h3 id="temp.param">#[temp.param]</h3>
<p>Change paragraph 1:</p>
<blockquote>
<p>[…]</p>
<p><u>The component names of a <em>type-constraint</em> are its <em>concept-name</em> and those of its <em>nested-name-specifier</em> (if any).</u> [<em>Note</em>: The <code>&gt;</code> token following the <em>template-parameter-list</em> of a <em>type-parameter</em> may be the product of replacing a <code>&gt;&gt;</code> token by two consecutive <code>&gt;</code> tokens ([temp.names]). — <em>end note</em>]</p>
</blockquote>
<p>Change paragraph 3:</p>
<blockquote>
<p><u>The <em>identifier</em> in a <em>type-parameter</em> is not looked up.</u> A <em>type-parameter</em> whose <s>identifier</s><u><em>identifier</em></u> does not follow an ellipsis defines its <em>identifier</em> to be a <em>typedef-name</em> (if declared without <code>template</code>) or <em>template-name</em> (if declared with <code>template</code>) in the scope of the template declaration. [<em>Note</em>: […]</p>
<p>— <em>end note</em>]</p>
</blockquote>
<p>Change paragraph 12:</p>
<blockquote>
<p>[…] If a friend function template declaration<u> <em>D</em></u> specifies a default <em>template-argument</em>, that declaration shall be a definition and <u>there </u>shall be <s>the only</s><u>no other</u> declaration of the function template <s>in the translation unit</s><u>which is reachable from <em>D</em> or from which <em>D</em> is reachable</u>.</p>
</blockquote>
<p>Change paragraph 15:</p>
<blockquote>
<p>A <em>template-parameter</em> shall not be given default arguments by two different declarations <s>in the same scope</s><u>if one is reachable from the other</u>. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<h3 id="temp.names">#[temp.names]</h3>
<p>Change paragraph 1:</p>
<blockquote>
<p>[…]</p>
<p><s>[<em>Note</em>: The name lookup rules ([basic.lookup]) are used to associate the use of a name with a template declaration; that is, to identify a name as a <em>template-name</em>. — <em>end note</em>]</s> <u>The component name of a <em>simple-template-id</em>, <em>template-id</em>, or <em>template-name</em> is the first name in it.</u></p>
</blockquote>
<p>Change paragraph 2:</p>
<blockquote>
<p><s>For a <em>template-name</em> to be explicitly qualified by the template arguments, the name must be considered to refer to a template. [<em>Note</em>: Whether a name actually refers to a template cannot be known in some cases until after argument dependent lookup is done ([basic.lookup.argdep]). — <em>end note</em>]</s> A <s>name</s><u><code>&lt;</code></u> is <s>considered to refer to</s><u>interpreted as the delimiter of</u> a <s>template</s><u><em>template-argument-list</em></u> if<u> it follows a name that is not a <em>conversion-function-id</em> and</u></p>
<ol style="list-style-type: decimal">
<li><u>that follows the keyword <code>template</code> or a <code>~</code> after a <em>nested-name-specifier</em> or in a class member access expression, or</u></li>
<li><u>for which </u>name lookup finds <s>a <em>template-name</em> or an overload set that contains a function template.</s><u>the injected-class-name of a class template or finds any declaration of a template, or</u></li>
<li><s>A name is also considered to refer to a template if it</s><u>that</u> is an <s><em>unqualified-id</em> followed by a <code>&lt;</code> and</s><u>unqualified name for which</u> name lookup either finds one or more functions or finds nothing<s>.</s><u>, or</u></li>
<li><u>that is a terminal name in a <em>using-declarator</em> ([namespace.udecl]), a <em>declarator-id</em> ([dcl.meaning]), or a type-only context other than a <em>nested-name-specifier</em> ([temp.res]).</u></li>
</ol>
<p><u>[<em>Note</em>: If the name is an <em>identifier</em>, it is then interpreted as a <em>template-name</em>. The keyword <code>template</code> is used to indicate that a dependent qualified name ([temp.dep.type]) denotes a template where an expression might appear. — <em>end note</em>]</u></p>
</blockquote>
<div class="mv">
<p>Move the example from paragraph 4 to the end of paragraph 2.</p>
</div>
<p>Change paragraph 3:</p>
<blockquote>
<p><s>When a name is considered to be a <em>template-name</em>, and it is followed by a <code>&lt;</code>, the <code>&lt;</code> is always taken as the delimiter of a <em>template-argument-list</em> and never as the less-than operator.</s> When parsing a <em>template-argument-list</em>, the first non-nested <code>&gt;</code><sup>[…]</sup> is taken as the ending delimiter rather than a greater-than operator. Similarly, the first non-nested <code>&gt;&gt;</code> is treated as two consecutive but distinct <code>&gt;</code> tokens, the first of which is taken as the end of the <em>template-argument-list</em> and completes the <em>template-id</em>. [<em>Note</em>: The second <code>&gt;</code> token produced by this replacement rule may terminate an enclosing <em>template-id</em> construct or it may be part of a different construct (e.g., a cast).— <em>end note</em>] [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 4:</p>
<blockquote>
<p>The keyword <code>template</code> <s>is said to appear at the top level in a <em>qualified-id</em> if it appears outside of a <em>template-argument-list</em> or <em>decltype-specifier</em>. In a <em>qualified-id</em> of a <em>declarator-id</em> or in a <em>qualified-id</em> formed by a <em>class-head-name</em> ([class.pre]) or <em>enum-head-name</em> ([dcl.enum]), the keyword <code>template</code> </s>shall not appear <s>at the top level</s><u>immediately after a declarative <em>nested-name-specifier</em> ([expr.prim.id.qual])</u>. <s>In a <em>qualified-id</em> used as the name in a <em>typename-specifier</em> ([temp.res]), <em>elaborated-type-specifier</em> ([dcl.type.elab]), <em>using-declaration</em> ([namespace.udecl]), or <em>class-or-decltype</em> ([class.derived]), an optional keyword <code>template</code> appearing at the top level is ignored. In these contexts, a <code>&lt;</code> token is always assumed to introduce a <em>template-argument-list</em>. In all other contexts, when naming a template specialization of a member of an unknown specialization ([temp.dep.type]), the member template name shall be prefixed by the keyword <code>template</code>. [<em>Example</em>:</s></p>
<p><s>[…]</s></p>
<p><s>— <em>end example</em>]</s></p>
</blockquote>
<p>Change paragraph 5:</p>
<blockquote>
A name prefixed by the keyword <code>template</code> shall be <s>a <em>template-id</em></s><u>followed by a template argument list</u> or <s>the name shall </s>refer to a class template or an alias template. <u>The latter case is deprecated ([depr.template.template]). The keyword <code>template</code> shall not appear immediately before a <code>~</code> token (as to name a destructor).</u> [<em>Note</em>: The keyword <code>template</code> may not be applied to non-template members of class templates. — <em>end note</em>][<em>Note</em>: As is the case with the <code>typename</code> prefix, the <code>template</code> prefix is allowed <s>in cases where it is not strictly necessary; i.e., when the <em>nested-name-specifier</em> or the expression on the left of the <code>-&gt;</code> or <code>.</code> is not dependent on a <em>template-parameter</em>, or the use does not appear in the scope of</s><u>even when lookup for the name would already find</u> a template. — <em>end note</em>] [<em>Example</em>:
<pre class="cpp">
template &lt;class T&gt; struct A {
  void f(int);
  template &lt;class U&gt; void f(U);
};

template &lt;class T&gt; void f(T t) {
  A&lt;T&gt; a;
  a.template f&lt;&gt;(t);                    // OK: calls template
  a.template f(t);                      // error: not a template-id
}

template &lt;class T&gt; struct B {
  template &lt;class T2&gt; struct C { };
};

// <s>OK</s><u>deprecated</u>: T::<s>template </s>C <u>would be assumed to </u>name<s>s</s> a class template:
template &lt;class T, template &lt;class X&gt; class TT = T::template C&gt; struct D { };
D&lt;B&lt;int&gt; &gt; db;
</pre>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 7:</p>
<blockquote>
<p>When the <em>template-name</em> of a <em>simple-template-id</em> names a constrained non-function template or a constrained template <em>template-parameter</em><s>, but not a member template that is a member of an unknown specialization ([temp.res])</s>, and all <em>template-argument</em>⁠s in the <em>simple-template-id</em> are non-dependent ([temp.dep.temp]), the associated constraints ([temp.constr.decl]) of the constrained template shall be satisfied ([temp.constr.constr]). [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<h3 id="temp.arg">#[temp.arg]</h3>
<p>Insert before paragraph 2:</p>
<div class="ins">
<blockquote>
<p>The template argument list of a <em>template-head</em> is a template argument list in which the <em>n</em><sup>th</sup> template argument has the value of the <em>n</em><sup>th</sup> template parameter of the <em>template-head</em>. If the <em>n</em><sup>th</sup> template parameter is a template parameter pack ([temp.variadic]), the <em>n</em><sup>th</sup> template argument is a pack expansion whose pattern is the name of the template parameter pack.</p>
</blockquote>
</div>
<p>Change paragraph 3:</p>
<blockquote>
<p><s>The name of</s><u>[<em>Note</em>: Names used in</u> a <em>template-argument</em> <s>shall be accessible at the point where it is used as a <em>template-argument</em></s><u>are subject to access control where they appear</u>. <s>[<em>Note</em>: If the name of the <em>template-argument</em> is accessible at the point where it is used as a <em>template-argument</em>, there is no further access restriction in the resulting instantiation where the corresponding</s><u>Since a</u> <em>template-parameter</em><s> name</s> is <s>used</s><u>not a class member, no access control applies</u>. — <em>end note</em>] [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>] For a <em>template-argument</em> that is a class type or a class template, the template definition has no special access rights to the members of the <em>template-argument</em>. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 7:</p>
<blockquote>
<p>When name lookup for the <u>component </u>name <s>in</s><u>of</u> a <em>template-id</em> finds an overload set, both non-template functions in the overload set and function templates in the overload set for which the <em>template-argument</em>⁠s do not match the <em>template-parameter</em>⁠s are ignored. <u>[<em>Note</em>: </u>If none of the function templates have matching <em>template-parameter</em>⁠s, the program is ill-formed.<u> — <em>end note</em>]</u></p>
</blockquote>
<h4 id="temp.arg.template">#[temp.arg.template]</h4>
<p>Change paragraph 2:</p>
<blockquote>
<p>Any partial specializations ([temp.class.spec]) associated with the primary class template or primary variable template are considered when a specialization based on the template <em>template-parameter</em> is instantiated. If a specialization is not <s>visible at</s><u>reachable from</u> the point of instantiation, and it would have been selected had it been <s>visible</s><u>reachable</u>, the program is ill-formed, no diagnostic required. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<h3 id="temp.decls">#[temp.decls]</h3>
<p>Replace paragraph 1 (adapting [temp.class.spec]/1):</p>
<div class="del">
<blockquote>
<p>A <em>template-id</em>, that is, the <em>template-name</em> followed by a <em>template-argument-list</em> […]</p>
</blockquote>
</div>
<div class="ins">
<blockquote>
<p>A <em>primary template</em> declaration is one in which the name of the template is not followed by a <em>template-argument-list</em>. The template argument list of a primary template is the template argument list of its <em>template-head</em> ([temp.arg]). A template declaration in which the name of the template is followed by a <em>template-argument-list</em> is a <em>partial specialization</em> of the template named in the declaration ([temp.class.spec]).</p>
</blockquote>
</div>
<h4 id="temp.class">#[temp.class]</h4>
<p>Change paragraph 3:</p>
<blockquote>
<p><u>[<em>Note</em>: </u>When a member<s> function, a member class, a member enumeration, a static data member or a member template</s> of a class template is defined outside of the class template definition, the member definition is defined as a template definition <s>in which the</s><u>with a</u> <em>template-head</em><s> is</s> equivalent to that of the class template<s> ([temp.over.link])</s>. The names of the template parameters used in the definition of the member <s>may be different</s><u>can differ</u> from the template parameter names used in the class template definition. The <s>template argument list following the </s>class template name in the member definition <s>shall name the parameters in the same order as the one used in the template parameter list of the member</s><u>is followed by the template argument list of the <em>template-head</em> ([temp.arg])</u>. <s>Each template parameter pack shall be expanded with an ellipsis in the template argument list.</s> [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>] <u>— <em>end note</em>]</u></p>
</blockquote>
<p>Change paragraph 4:</p>
<blockquote>
<p>In a <s>redeclaration, </s>partial specialization, explicit specialization or explicit instantiation of a class template, the <em>class-key</em> shall agree in kind with the original class template declaration ([dcl.type.elab]).</p>
</blockquote>
<h5 id="temp.deduct.guide">#[temp.deduct.guide]</h5>
<p>Change paragraph 1:</p>
<blockquote>
<p>Deduction guides are used when a <em>template-name</em> appears as a type specifier for a deduced class type ([dcl.type.class.deduct]). Deduction guides are not found by name lookup. Instead, when performing class template argument deduction ([over.match.class.deduct]), <s>any</s><u>all reachable</u> deduction guides declared for the class template are considered.</p>
</blockquote>
<p>Change paragraph 3:</p>
<blockquote>
<p>[…] A <em>deduction-guide</em> shall <s>be declared in</s><u>inhabit</u> the <s>same </s>scope <s>as</s><u>to which</u> the corresponding class template<u> belongs</u> and, for a member class template, <s>with</s><u>have</u> the same access. Two deduction guide declarations<s> in the same translation unit</s> for the same class template shall not have equivalent <em>parameter-declaration-clause</em>s<u> if either is reachable from the other</u>.</p>
</blockquote>
<h4 id="temp.mem">#[temp.mem]</h4>
<p>Change paragraph 5:</p>
<blockquote>
<p><u>[<em>Note</em>: </u>A specialization of a conversion function template is referenced in the same way as a non-template conversion function that converts to the same type<u> ([class.conv.fct])</u>. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>] <s>[<em>Note</em>: </s>There is no syntax to form a <em>template-id</em> ([temp.names]) by providing an explicit template argument list ([temp.arg.explicit]) for a conversion function template<s> ([class.conv.fct])</s>. — <em>end note</em>]</p>
</blockquote>
<p>Remove paragraphs 6 through 8:</p>
<div class="del">
<blockquote>
<p>A specialization of a conversion function template is not found by name lookup. […]</p>
</blockquote>
<blockquote>
<p>A <em>using-declaration</em> in a derived class cannot refer to a specialization of a conversion function template in a base class.</p>
</blockquote>
<blockquote>
<p>Overload resolution ([over.ics.rank]) and partial ordering ([temp.func.order]) are used to select the best conversion function […]</p>
</blockquote>
</div>
<h4 id="temp.friend">#[temp.friend]</h4>
<p>Change paragraph 1:</p>
<blockquote>
<p>A friend of a class or class template can be a function template or class template, a specialization of a function template or class template, or a non-template function or class. <s>For a friend function declaration that is not a template declaration:</s></p>
<ol style="list-style-type: decimal">
<li><s>if the name of the friend is a qualified or unqualified <em>template-id</em>, the friend declaration refers to a specialization of a function template, otherwise,</s></li>
<li><s>if the name of the friend is a <em>qualified-id</em> and a matching non-template function is found in the specified class or namespace, the friend declaration refers to that function, otherwise,</s></li>
<li><s>if the name of the friend is a <em>qualified-id</em> and a matching function template is found in the specified class or namespace, the friend declaration refers to the deduced specialization of that function template ([temp.deduct.decl]), otherwise,</s></li>
<li><s>the name shall be an <em>unqualified-id</em> that declares (or redeclares) a non-template function.</s></li>
</ol>
<p>[<em>Example</em>:</p>
<p>[…] — <em>end example</em>]</p>
</blockquote>
<p>Move [temp.inject]/1 before paragraph 2 and change it:</p>
<div class="mv">
<blockquote>
<p>Friend classes<s> or</s><u>, class templates,</u> functions<u>, or function templates</u> can be declared within a class template. When a template is instantiated, <s>the names of </s>its friend<s>s are treated</s><u> declarations are found by name lookup</u> as if the specialization had been explicitly declared at its point of instantiation. <u>[<em>Note</em>: They may introduce entities that belong to an enclosing namespace scope ([dcl.meaning]), in which case they are attached to the same module as the class template ([module.unit]). — <em>end note</em>]</u></p>
</blockquote>
</div>
<p>Change paragraph 4:</p>
<blockquote>
<p>[…] In this case, a member of a specialization <em>S</em> of the class template is a friend of the class granting friendship if deduction of the template parameters of <em>C</em> from <em>S</em> succeeds, and substituting the deduced template arguments into the friend declaration produces a declaration that <s>would be a valid redeclaration of</s><u>corresponds to</u> the member of the specialization. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Remove paragraph 5 (whose substance is incorporated in the above):</p>
<div class="del">
<blockquote>
<p>[<em>Note</em>: A friend declaration may first declare a member of an enclosing namespace scope ([temp.inject]). — <em>end note</em>]</p>
</blockquote>
</div>
<h4 id="temp.class.spec">#[temp.class.spec]</h4>
<p>Change paragraph 1 (moving part of it to [temp.decls]):</p>
<blockquote>
<p><s>A <em>primary class template</em> declaration is one in which the class template name is an identifier. A template declaration in which the class template name is a <em>simple-template-id</em> is a <em>partial specialization</em> of the class template named in the <em>simple-template-id</em>.</s> A partial specialization of a class template provides an alternative definition of the template that is used instead of the primary definition when the arguments in a specialization match those given in the partial specialization ([temp.class.spec.match]). <s>The</s><u>A declaration of the</u> primary template shall <s>be declared before</s><u>precede</u> any specialization<s>s</s> of that template. A partial specialization shall <s>be declared before the first</s><u>be reachable from any</u> use of a class template specialization that would make use of the partial specialization as the result of an implicit or explicit instantiation<s> in every translation unit in which such a use occurs</s>; no diagnostic is required.</p>
</blockquote>
<p>Change paragraph 2:</p>
<blockquote>
<p><u>Two partial specialization declarations declare the same entity if they are partial specializations of the same template and have equivalent <em>template-head</em>s and template argument lists ([temp.over.link]).</u> Each class template partial specialization is a distinct template and definitions shall be provided for the members of a template partial specialization ([temp.class.spec.mfunc]).</p>
</blockquote>
<p>Change paragraph 5:</p>
<blockquote>
<p>The template parameters are specified in the angle bracket enclosed list that immediately follows the keyword <code>template</code>. <s>For partial specializations, t</s><u>T</u>he template argument list<u> of a partial specialization</u> is <s>explicitly written immediately following the class template name</s><u>the <em>template-argument-list</em> of the <em>class-name</em></u>. <s>For primary templates, this list is implicitly described by the template parameter list. Specifically, the order of the template arguments is the sequence in which they appear in the template parameter list. [<em>Example</em>: The template argument list for the primary template in the example above is <code>&lt;T1,</code> <code>T2,</code> <code>I&gt;</code>. — <em>end example</em>] [<em>Note</em>: The template argument list shall not be specified in the primary template declaration. For example,</p>
<p>[…]</p>
<p>— <em>end note</em>]</s></p>
</blockquote>
<p>Change paragraph 7:</p>
<blockquote>
<p>Partial specialization declarations <s>themselves are not found by name lookup</s><u>do not introduce a name</u>. <s>Rather</s><u>Instead</u>, when the primary template name is used, any <s>previously-declared</s><u>reachable</u> partial specializations of the primary template are also considered. One consequence is that a <em>using-declaration</em> which refers to a class template does not restrict the set of partial specializations which may be found through the <em>using-declaration</em>. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<h5 id="temp.class.spec.mfunc">#[temp.class.spec.mfunc]</h5>
<p>Change paragraph 1:</p>
<blockquote>
<p><s>The template parameter list of a member of a class template partial specialization shall match the template parameter list of the class template partial specialization. The template argument list of a member of a class template partial specialization shall match the template argument list of the class template partial specialization.</s> A class template partial specialization is a distinct template. The members of the class template partial specialization are unrelated to the members of the primary template. Class template partial specialization members that are used in a way that requires a definition shall be defined; the definitions of members of the primary template are never used as definitions for members of a class template partial specialization. An explicit specialization of a member of a class template partial specialization is declared in the same way as an explicit specialization of the primary template. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<h4 id="temp.fct">#[temp.fct]</h4>
<p>Change paragraph 2:</p>
<blockquote>
<p><u>[<em>Note</em>: </u>A function template can <s>be overloaded with</s><u>have the same name as</u> other function templates and <s>with </s>non-template functions ([dcl.fct])<u> in the same scope</u>.<u> — <em>end note</em>]</u> A non-template function is not related to a function template (i.e., it is never considered to be a specialization), even if it has the same name and type as a potentially generated function template specialization.<sup>[…]</sup></p>
</blockquote>
<h5 id="temp.over.link">#[temp.over.link]</h5>
<p>Change paragraph 5, adding the first example from [over.dcl]/1:</p>
<blockquote>
<p>[…] For determining whether two dependent names ([temp.dep]) are equivalent, only the name itself is considered, not the result of name lookup<s> in the context of the template</s>. <u>[<em>Note</em>: </u>If <s>multiple declarations of the same function template differ in the result of this</s><u>such a dependent</u> name <s>lookup</s><u>is unqualified</u>, <s>the result for</s><u>it is looked up from</u> the first declaration <s>is used</s><u>of the function template ([temp.dep.candidate])</u>.<u> — <em>end note</em>]</u> [<em>Example</em>:</p>
[…]<br />
<pre class="cpp">
int i = h&lt;int&gt;();                               // template argument substitution fails; g(int)
                                                // <s>was </s>not <s>in scope</s><u>considered</u> at the first declaration of h()
</pre>
<p>[…]</p>
<p>— <em>end example</em>] […][<em>Note</em>: For instance, one could have redundant parentheses. — <em>end note</em>] <span class="mv">[<em>Example</em>:</span></p>
<p><span class="mv">[…]</span></p>
<p><span class="mv">— <em>end example</em>]</span></p>
</blockquote>
<p>Change paragraph 7:</p>
<blockquote>
<p><s>Two function templates are <em>equivalent</em> if they are declared in the same scope, have the same name, have equivalent <em>template-head</em>⁠s, and have return types, parameter lists, and trailing <em>requires-clause</em>⁠s (if any) that are equivalent using the rules described above to compare expressions involving template parameters. Two function templates are <em>functionally equivalent</em> if they are declared in the same scope, have the same name, accept and are satisfied by the same set of template argument lists, and have return types and parameter lists that are functionally equivalent using the rules described above to compare expressions involving template parameters.</s> If the validity or meaning of the program depends on whether two constructs are equivalent, and they are functionally equivalent but not equivalent, the program is ill-formed, no diagnostic required.</p>
</blockquote>
<h5 id="temp.func.order">#[temp.func.order]</h5>
<p>Change paragraph 1:</p>
<blockquote>
<p>If <s>a</s><u>multiple</u> function template<u>s</u> <s>is overloaded</s><u>share a name</u>, the use of <s>a function template specialization</s><u>that name</u> might be ambiguous because template argument deduction ([temp.deduct]) may <s>associate the function template</s><u>identify a</u> specialization <s>with</s><u>for</u> more than one function template<s> declaration</s>. […]</p>
</blockquote>
<h4 id="temp.concept">#[temp.concept]</h4>
<p>Change paragraph 3:</p>
<blockquote>
<p>A <em>concept-definition</em> shall <s>appear at</s><u>inhabit a</u> namespace scope ([basic.scope.namespace]).</p>
</blockquote>
<h3 id="temp.res">#[temp.res]</h3>
<p>Replace paragraph 1:</p>
<div class="del">
<blockquote>
<p>Three kinds of names can be used within a template definition:</p>
<ol style="list-style-type: decimal">
<li>[…]</li>
</ol>
</blockquote>
</div>
<div class="ins">
<blockquote>
<p>A name that appears in a declaration <em>D</em> of a template <em>T</em> is looked up from where it appears in an unspecified declaration of <em>T</em> that is or is reachable from <em>D</em> and from which no other declaration of <em>T</em> that contains the usage of the name is reachable. If the name is <em>dependent</em> (as specified in [temp.dep]), it is looked up for each specialization (after substitution) because the lookup depends on a template parameter. [<em>Note</em>: Some dependent names are also looked up during parsing to determine that they are dependent or to interpret following <code>&lt;</code> tokens. Uses of other names might be type-dependent or value-dependent ([temp.dep.expr], [temp.dep.constexpr]). A <em>using-declarator</em> is never dependent in a specialization and is therefore replaced during lookup for that specialization ([basic.lookup]). — <em>end note</em>] [<em>Example</em>:</p>
<pre class="sourceCode cpp"><code class="sourceCode cpp"><span class="kw">struct</span> A {<span class="kw">operator</span> <span class="dt">int</span>();};
<span class="kw">template</span>&lt;<span class="kw">class</span> B,<span class="kw">class</span> T&gt;
<span class="kw">struct</span> D : B {
  T get() {<span class="kw">return</span> <span class="kw">operator</span> T();}     <span class="co">// conversion-function-id is dependent</span>
};
<span class="dt">int</span> f(D&lt;A,<span class="dt">int</span>&gt; d) {<span class="kw">return</span> d.get();}  <span class="co">// OK: lookup finds A::operator int</span></code></pre>
<p>— <em>end example</em>]</p>
</blockquote>
</div>
<div class="mv">
<p>Move the example from paragraph 10 and the second example from [temp.dep]/4 to the end of paragraph 1.</p>
</div>
<p>Replace paragraph 2 (but not the grammar following it):</p>
<div class="del">
<blockquote>
<p>A name used in a template declaration or definition and that is dependent on a <em>template-parameter</em> is assumed not to name a type unless the applicable name lookup finds a type name or the name is qualified by the keyword <code>typename</code>. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
</div>
<div class="ins">
<blockquote>
<p>If the validity or meaning of the program would be changed by considering a default argument or default template argument introduced in a declaration that is reachable from the point of instantiation of a specialization ([temp.point]) but is not found by lookup for the specialization, the program is ill-formed, no diagnostic required.</p>
</blockquote>
</div>
<p>Change paragraph 3:</p>
<blockquote>
<p><u>The component names of a <em>typename-specifier</em> are its <em>identifier</em> (if any) and those of its <em>nested-name-specifier</em> and <em>simple-template-id</em> (if any).</u> A <em>typename-specifier</em> denotes the type or class template denoted by the <em>simple-type-specifier</em> ([dcl.type.simple]) formed by omitting the keyword <code>typename</code>. <u>[<em>Note</em>: </u>The usual qualified name lookup ([basic.lookup.qual]) <s>is used to find the <em>qualified-id</em></s><u>applies</u> even in the presence of <code>typename</code>.<u> — <em>end note</em>]</u> [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Remove paragraph 4:</p>
<div class="del">
<blockquote>
<p>A qualified name used as the name in a <em>class-or-decltype</em> ([class.derived]) or an <em>elaborated-type-specifier</em> is implicitly assumed to name a type, […]</p>
</blockquote>
</div>
<p>Change paragraph 5:</p>
<blockquote>
<p>A <s><em>qualified-id</em></s><u>qualified or unqualified name</u> is <s>assumed</s><u>said</u> to <s>name</s><u>be in</u> a type<u>-only context</u> if<u> it is the terminal name of</u></p>
<ol style="list-style-type: decimal">
<li><s>it is a qualified name in </s>a <s>type-id-only context (see below)</s><u><em>typename-specifier</em>, <em>nested-name-specifier</em>, <em>elaborated-type-specifier</em>, <em>class-or-decltype</em></u>, or</li>
<li><u>a <em>type-specifier</em> of a <em>new-type-id</em>, <em>defining-type-id</em>, <em>conversion-type-id</em>, <em>trailing-return-type</em>, default argument of a <em>type-parameter</em>, or <em>type-id</em> of a <code>static_cast</code>, <code>const_cast</code>, <code>reinterpret_cast</code>, or <code>dynamic_cast</code>, or</u></li>
<li><s>it is </s>a <em>decl-specifier</em> of the <em>decl-specifier-seq</em> of a
<ol style="list-style-type: decimal">
<li><em>simple-declaration</em> or a <em>function-definition</em> in namespace scope,</li>
<li><em>member-declaration</em>,</li>
<li><em>parameter-declaration</em> in a <em>member-declaration</em><sup>[…]</sup>, unless that <em>parameter-declaration</em> appears in a default argument,</li>
<li><em>parameter-declaration</em> in a <em>declarator</em> of a function or function template declaration whose <em>declarator-id</em> is qualified, unless that <em>parameter-declaration</em> appears in a default argument,</li>
<li><em>parameter-declaration</em> in a <em>lambda-declarator</em>, unless that <em>parameter-declaration</em> appears in a default argument, or</li>
<li><em>parameter-declaration</em> of a (non-type) <em>template-parameter</em>.</li>
</ol></li>
</ol>
<p><s>A qualified name is said to be in a <em>type-id-only context</em> if it appears in a <em>type-id</em>, <em>new-type-id</em>, or <em>defining-type-id</em> and the smallest enclosing <em>type-id</em>, <em>new-type-id</em>, or <em>defining-type-id</em> is a <em>new-type-id</em>, <em>defining-type-id</em>, <em>trailing-return-type</em>, default argument of a <em>type-parameter</em> of a template, or <em>type-id</em> of a <code>static_cast</code>, <code>const_cast</code>, <code>reinterpret_cast</code>, or <code>dynamic_cast</code>.</s> [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 6:</p>
<blockquote>
<p>A <em>qualified-id</em> <s>that refers to a member of an unknown specialization, that is not prefixed by <code>typename</code>, and</s><u>whose terminal name is dependent and</u> that is <s>not otherwise assumed to name</s><u>in</u> a type<u>-only context</u> <s>(see above)</s><u>is considered to</u> denote<s>s</s> a <s>non-</s>type. <u>A name that refers to a <em>using-declarator</em> whose terminal name is dependent is interpreted as a <em>typedef-name</em> if the <em>using-declarator</em> uses the keyword <code>typename</code>.</u> [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Remove paragraph 7:</p>
<div class="del">
<blockquote>
<p>Within the definition of a class template or within the definition of a member of a class template following the <em>declarator-id</em>, […]</p>
</blockquote>
</div>
<p>Change paragraph 8:</p>
<blockquote>
[…] [<em>Example</em>:
<pre class="cpp">
int j;
template&lt;class T&gt; class X {
  void f(T t, int i, char* p) {
    t = i;          // diagnosed if X::f is instantiated, and the assignment to t is an error
    p = i;          // may be diagnosed even if X::f is not instantiated
    p = j;          // may be diagnosed even if X::f is not instantiated<u>
    X&lt;T&gt;::g(t);     // OK
    X&lt;T&gt;::h();      // may be diagnosed even if X::f is not instantiated</u>
  }
  void g(T t) {
    +;              // may be diagnosed even if X::g is not instantiated
  }
};

template&lt;class... T&gt; struct A {
  void operator++(int, T... t);                     // error: too many parameters
};
template&lt;class... T&gt; union X : T... { };            // error: union with base class
template&lt;class... T&gt; struct A : T...,  T... { };    // error: duplicate base class
</pre>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Remove paragraphs 9 and 10 (whose example is moved to paragraph 1):</p>
<div class="del">
<blockquote>
<p>When looking for the declaration of a name used in a template definition, […]</p>
</blockquote>
<blockquote>
<p>If a name does not depend on a <em>template-parameter</em> (as defined in [temp.dep]), […]</p>
</blockquote>
</div>
<h4 id="temp.local">#[temp.local]</h4>
<p>Change paragraph 2:</p>
<blockquote>
<p><s>Within</s><u>When</u> the <s>scope</s><u>injected-class-name</u> of a class template specialization or partial specialization<s>, when the injected-class-name</s> is used as a <em>type-name</em>, it is equivalent to the <em>template-name</em> followed by the <em>template-argument</em>⁠s of the class template specialization or partial specialization enclosed in <code>&lt;&gt;</code>. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 3:</p>
<blockquote>
The injected-class-name of a class template or class template specialization can be used as either a <em>template-name</em> or a <em>type-name</em> wherever it is <s>in scope</s><u>named</u>. [<em>Example</em>:
<pre class="cpp">
template &lt;class T&gt; struct Base {
  Base* p;
};

template &lt;class T&gt; struct Derived: public Base&lt;T&gt; {
  typename Derived::Base* p;            // meaning Derived::Base&lt;T&gt;
};

template&lt;class T, template&lt;class&gt; class U = T::<s>template </s>Base&gt; struct Third { };
Third&lt;Derived&lt;int&gt; &gt; t;                 // OK: default argument uses injected-class-name as a template
</pre>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 6:</p>
<blockquote>
The name of a <em>template-parameter</em> shall not be <s>redeclared within its</s><u>bound to any following declaration contained by the</u> scope <s>(including nested scopes)</s><u>to which the <em>template-parameter</em> belongs</u>. <s>A <em>template-parameter</em> shall not have the same name as the template name.</s> [<em>Example</em>:
<pre class="cpp">
template&lt;class T, int i&gt; class Y {
  int T;                                // error: template-parameter <s>redeclared</s><u>hidden</u>
  void f() {
    char T;                             // error: template-parameter <s>redeclared</s><u>hidden</u>
  }<u>
  friend void T();                      // OK: no name bound</u>
};

template&lt;class X&gt; class X;              // error: <u>hidden by </u>template-parameter<s> redeclared</s>
</pre>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 7:</p>
<blockquote>
<s>In the definition of a member</s><u>Unqualified name lookup considers the template parameter scope of a <em>template-declaration</em> immediately after the outermost scope associated with the template declared (even if its parent scope does not contain the <em>template-parameter-list</em>).<!-- remote --> [<em>Note</em>: The scope</u> of a class template<s> that appears outside of the class template definition, the name of a member of the class template hides the name of a <em>template-parameter</em> of any enclosing class templates (but not a <em>template-parameter</em> of the member if the member is a class or function template)</s><u>, including its non-dependent base classes ([temp.dep.type], [class.member.lookup]), is searched before its template parameter scope</u>.<u> — <em>end note</em>]</u> [<em>Example</em>:
<pre class="cpp">
<u>struct B { };
namespace N {
  typedef void V;
  </u>template&lt;class T&gt; struct A <u>: B </u>{
<s>  struct B { /* ... */ };
</s><u>  </u>  typedef void C;
<u>  </u>  void f();
<u>  </u>  template&lt;class U&gt; void g(U);
<u>  </u>};
<u>}
</u>
template&lt;class <s>B</s><u>V</u>&gt; void <u>N::</u>A&lt;<s>B</s><u>V</u>&gt;::f() {<u>  // N::V not considered here</u>
  <s>B</s><u>V</u> <s>b</s><u>v</u>;              // <s>A's B, not</s><u>V is still</u> the template parameter<u>, not N::V</u>
}

template&lt;class B&gt; template&lt;class C&gt; void <u>N::</u>A&lt;B&gt;::g(C) {
  B b;              // <s>A's B</s><u>the base class</u>, not the template parameter
  C c;              // the template parameter C, not A's C
}
</pre>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Remove paragraphs 8 and 9 (whose examples are merged into the above):</p>
<div class="del">
<blockquote>
<p>In the definition of a member of a class template that appears outside of the namespace containing the class template definition, […]</p>
</blockquote>
<blockquote>
<p>In the definition of a class template or in the definition of a member of such a template that appears outside of the template definition, […]</p>
</blockquote>
</div>
<h4 id="temp.dep">#[temp.dep]</h4>
<p>Change paragraph 2:</p>
<blockquote>
<p><s>In</s><u>A <em>dependent call</em> is</u> an expression<u>, possibly formed as a non-member candidate for an operator ([over.match.oper]),</u> of the form:</p>
<blockquote>
<p><em>postfix-expression</em> <code>(</code> <em>expression-list</em><sub><em>opt</em></sub> <code>)</code></p>
</blockquote>
<p>where the <em>postfix-expression</em> is an <em>unqualified-id</em><s>, the <em>unqualified-id</em> denotes a <em>dependent name</em> if</s><u> and</u></p>
<ol style="list-style-type: decimal">
<li>any of the expressions in the <em>expression-list</em> is a pack expansion ([temp.variadic]),</li>
<li>any of the expressions or <em>braced-init-list</em>⁠s in the <em>expression-list</em> is type-dependent ([temp.dep.expr]), or</li>
<li>the <em>unqualified-id</em> is a <em>template-id</em> in which any of the template arguments depends on a template parameter.</li>
</ol>
<p><s>If an operand of an operator is a type-dependent expression, the operator also denotes a dependent name.</s> <u>The component name of an <em>unqualified-id</em> is dependent if</u></p>
<ol style="list-style-type: decimal">
<li><u>it is a <em>conversion-function-id</em> whose <em>conversion-type-id</em> is dependent, or</u></li>
<li><u>it is <code>operator=</code> and the current class is a templated entity, or</u></li>
<li><u>the <em>unqualified-id</em> is the <em>postfix-expression</em> in a dependent call.</u></li>
</ol>
<p>[<em>Note</em>: Such names <s>are unbound and </s>are looked up <u>only </u>at the point of the template instantiation ([temp.point]) in both the context of the template definition and the context of the point of instantiation ([temp.dep.candidate]). — <em>end note</em>]</p>
</blockquote>
<p>Remove paragraph 4 (whose second example is moved to [temp.res]/1):</p>
<div class="del">
<blockquote>
<p>In the definition of a class or class template, the scope of a dependent base class ([temp.dep.type]) is not examined […]</p>
</blockquote>
</div>
<h5 id="temp.dep.type">#[temp.dep.type]</h5>
<p>Change paragraph 1:</p>
<blockquote>
<p>A name<u> or <em>template-id</em></u> refers to the <em>current instantiation</em> if it is</p>
<ol style="list-style-type: decimal">
<li>in the definition of a class template, a nested class of a class template, a member of a class template, or a member of a nested class of a class template, the injected-class-name ([class.pre]) of the class template or nested class,</li>
<li>in the definition of a primary class template or a member of a primary class template, the name of the class template followed by the template argument list of <s>the primary template </s><u>its <em>template-head</em> </u>(<s>as described below</s><u>[temp.arg]</u>) enclosed in <code>&lt;&gt;</code> (or an equivalent template alias specialization),</li>
<li>in the definition of a nested class of a class template, the name of the nested class referenced as a member of the current instantiation, or</li>
<li>in the definition of a partial specialization or a member of a partial specialization, the name of the class template followed by <s>the</s><u>a</u> template argument list <u>equivalent to that </u>of the partial specialization<u> ([temp.class.spec])</u> enclosed in <code>&lt;&gt;</code> (or an equivalent template alias specialization). <s>If the <em>n</em><sup>th</sup> template parameter is a template parameter pack, the <em>n</em><sup>th</sup> template argument is a pack expansion ([temp.variadic]) whose pattern is the name of the template parameter pack.</s></li>
</ol>
</blockquote>
<p>Remove paragraph 2 (adapted in [temp.arg]):</p>
<div class="del">
<blockquote>
<p>The template argument list of a primary template is a template argument list […]</p>
</blockquote>
</div>
<p>Change paragraph 5:</p>
<blockquote>
<p>A <u>qualified ([basic.lookup.qual]) or unqualified </u>name is a <em>member of the current instantiation</em> if<s> it is</s></p>
<ol style="list-style-type: decimal">
<li><u>its lookup context, if it is a qualified name, is the current instantiation, and</u></li>
<li><s>An unqualified name that, when looked up, refers to at least one</s><u>lookup for it finds any</u> member of a class that is the current instantiation<s> or a non-dependent base class thereof</s>. <s>[<em>Note</em>: This can only occur when looking up a name in a scope enclosed by the definition of a class template. — <em>end note</em>]</s></li>
<li><s>A <em>qualified-id</em> in which the <em>nested-name-specifier</em> refers to the current instantiation and that, when looked up, refers to at least one member of a class that is the current instantiation or a non-dependent base class thereof. [<em>Note</em>: If no such member is found, and the current instantiation has any dependent base classes, then the <em>qualified-id</em> is a member of an unknown specialization; see below. — <em>end note</em>]</s></li>
<li><s>An <em>id-expression</em> denoting the member in a class member access expression ([expr.ref]) for which the type of the object expression is the current instantiation, and the <em>id-expression</em>, when looked up ([basic.lookup.classref]), refers to at least one member of a class that is the current instantiation or a non-dependent base class thereof. [<em>Note</em>: If no such member is found, and the current instantiation has any dependent base classes, then the <em>id-expression</em> is a member of an unknown specialization; see below. — <em>end note</em>]</s></li>
</ol>
<p>[<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
<p>A <u>qualified or unqualified </u>name <s>is</s><u>names</u> a <em>dependent member of the current instantiation</em> if it is a member of the current instantiation that, when looked up, refers to at least one member<u> declaration (including a <em>using-declarator</em> whose terminal name is dependent)</u> of a class that is the current instantiation.</p>
</blockquote>
<p>Change paragraph 6:</p>
<blockquote>
<p>A <u>qualified </u>name<u> ([basic.lookup.qual])</u> is <s>a <em>member of an unknown specialization</em></s><u>dependent</u> if it is</p>
<ol style="list-style-type: decimal">
<li><u>it is a <em>conversion-function-id</em> whose <em>conversion-type-id</em> is dependent, or</u></li>
<li><s>A <em>qualified-id</em> in which the <em>nested-name-specifier</em> names</s><u>its lookup context</u> is <s>a </s>dependent <s>type that</s><u>and</u> is not the current instantiation<s>.</s><u>, or</u></li>
<li><u>its lookup context is the current instantiation and it is <code>operator=</code>[<em>Footnote</em>: Every instantiation of a class template declares a different set of assignment operators. — <em>end footnote</em>], or</u></li>
<li><s>A <em>qualified-id</em> in which the <em>nested-name-specifier</em> refers to</s><u>its lookup context is</u> the current instantiation<s>, the current instantiation</s><u> and</u> has at least one dependent base class, and qualified name lookup <s>of</s><u>for</u> the <s><em>qualified-id</em></s><u>name</u> <s>does not </s>find<u>s nothing ([basic.lookup.qual])</u><s> any member of a class that is the current instantiation or a non-dependent base class thereof</s>.</li>
<li><s>[…]</s> <u>[<em>Example</em>:</u></li>
</ol>
<pre class="sourceCode cpp ins"><code class="sourceCode cpp"><span class="kw">struct</span> A {
  <span class="kw">using</span> B=<span class="dt">int</span>;
  A f();
};
<span class="kw">struct</span> C : A {};
<span class="kw">template</span>&lt;<span class="kw">class</span> T&gt;
<span class="dt">void</span> g(T t) {
  <span class="kw">decltype</span>(t.A::f())::B i;  <span class="co">// error: typename needed to interpret B as a type</span>
}
<span class="kw">template</span> <span class="dt">void</span> g(C);         <span class="co">// ...even though A is ::A here</span></code></pre>
<p><u>— <em>end example</em>]</u></p>
</blockquote>
<p>Remove paragraph 7 (part of whose example is added to that in [temp.res]/8):</p>
<div class="del">
<blockquote>
<p>If a <em>qualified-id</em> in which the <em>nested-name-specifier</em> refers to the current instantiation is not a member of the current instantiation or a member of an unknown specialization, […]</p>
</blockquote>
</div>
<p>Change paragraph 8:</p>
<blockquote>
<p>If, for a given set of template arguments, a specialization of a template is instantiated that refers to a member of the current instantiation with a <s><em>qualified-id</em> or class member access expression</s><u>qualified name</u>, the name<s> in the <em>qualified-id</em> or class member access expression</s> is looked up in the template instantiation context. If the result of this lookup differs from the result of name lookup in the template definition context, name lookup is ambiguous. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 9:</p>
<blockquote>
<p>A type is dependent if it is</p>
<ol style="list-style-type: decimal">
<li>a template parameter,</li>
<li><u>denoted by </u>a <s>member of an unknown specialization</s><u>dependent (qualified) name</u>,</li>
<li>a nested class or enumeration that is a <s>dependent</s><u>direct</u> member of <u>a class that is </u>the current instantiation,</li>
<li>a cv-qualified type where the cv-unqualified type is dependent,</li>
<li>a compound type constructed from any dependent type,</li>
<li>an array type whose element type is dependent or whose bound (if any) is value-dependent,</li>
<li>a function type whose exception specification is value-dependent,</li>
<li>denoted by a <em>simple-template-id</em> in which either the template name is a template parameter or any of the template arguments is a dependent type or an expression that is type-dependent or value-dependent or is a pack expansion [<em>Note</em>: This includes an injected-class-name ([class.pre]) of a class template used without a <em>template-argument-list</em>. — <em>end note</em>], or</li>
<li>denoted by <code>decltype(</code><em>expression</em><code>)</code>, where <em>expression</em> is type-dependent ([temp.dep.expr]).</li>
</ol>
</blockquote>
<h5 id="temp.dep.expr">#[temp.dep.expr]</h5>
<p>Change paragraph 2:</p>
<blockquote>
<p><code>this</code> is type-dependent if the <u>current </u>class<s> type of the enclosing member function</s><u> ([expr.prim.this])</u> is dependent ([temp.dep.type]).</p>
</blockquote>
<p>Change paragraph 3:</p>
<blockquote>
<p>An <em>id-expression</em> is type-dependent if it is <u>a <em>template-id</em> that is </u>not a concept-id and <s>it contains</s><u>is dependent; or if its terminal name is</u></p>
<ol style="list-style-type: decimal">
<li><s>an <em>identifier</em> </s>associated by name lookup with one or more declarations declared with a dependent type,</li>
<li><s>an <em>identifier</em> </s>associated by name lookup with a non-type <em>template-parameter</em> declared with a type that contains a placeholder type ([dcl.spec.auto]),</li>
<li><s>an <em>identifier</em> </s>associated by name lookup with a variable declared with a type that contains a placeholder type ([dcl.spec.auto]) where the initializer is type-dependent,</li>
<li><s>an <em>identifier</em> </s>associated by name lookup with one or more declarations of member functions of <u>a class that is </u>the current instantiation declared with a return type that contains a placeholder type,</li>
<li><s>an <em>identifier</em> </s>associated by name lookup with a structured binding declaration ([dcl.struct.bind]) whose <em>brace-or-equal-initializer</em> is type-dependent,</li>
<li>the <em>identifier</em> <code>__func__</code> ([dcl.fct.def.general]), where any enclosing function is a template, a member of a class template, or a generic lambda,</li>
<li><s>a <em>template-id</em> that is dependent,</s></li>
<li>a <em>conversion-function-id</em> that specifies a dependent type, or</li>
<li><s>a <em>nested-name-specifier</em> or a <em>qualified-id</em> that names a member of an unknown specialization</s><u>dependent</u>;</li>
</ol>
<p>or if it names a dependent member of the current instantiation that is a static data member of type “array of unknown bound of <code>T</code>” for some <code>T</code> ([temp.static]). Expressions of the following forms are type-dependent only if the type specified by the <em>type-id</em>, <em>simple-type-specifier</em> or <em>new-type-id</em> is dependent, even if any subexpression is type-dependent:</p>
<blockquote>
<p>[…]</p>
</blockquote>
</blockquote>
<p>Change paragraph 5:</p>
<blockquote>
<p>A class member access expression ([expr.ref]) is type-dependent if <u>the terminal name of its <em>id-expression</em>, if any, is dependent or </u>the expression refers to a member of the current instantiation and the type of the referenced member is dependent<s>, or the class member access expression refers to a member of an unknown specialization</s>. [<em>Note</em>: In an expression of the form <code>x.y</code> or <code>xp-&gt;y</code> the type of the expression is usually the type of the member <code>y</code> of the class of <code>x</code> (or the class pointed to by <code>xp</code>). However, if <code>x</code> or <code>xp</code> refers to a dependent type that is not the current instantiation, the type of <code>y</code> is always dependent. <s>If <code>x</code> or <code>xp</code> refers to a non-dependent type or refers to the current instantiation, the type of <code>y</code> is the type of the class member access expression.</s> — <em>end note</em>]</p>
</blockquote>
<h5 id="temp.dep.temp">#[temp.dep.temp]</h5>
<p>Change paragraph 4:</p>
<blockquote>
<p>A template <em>template-argument</em> is dependent if it names a <em>template-parameter</em> or <u>its terminal name </u>is <s>a <em>qualified-id</em> that refers to a member of an unknown specialization</s><u>dependent</u>.</p>
</blockquote>
<div class="del">
<h4>#[temp.nondep]</h4>
</div>
<p>Remove subclause, referring the stable name to [temp.res]. Remove the cross reference in [basic.def.odr]/14. Update the one surviving cross reference (in [basic.link]/13.3) to refer to [temp.res].</p>
<h4 id="temp.dep.candidate">#[temp.dep.candidate]</h4>
<p>Change paragraph 1:</p>
<blockquote>
<p><s>For a function call where the <em>postfix-expression</em> is a dependent name, the candidate functions are found using the usual lookup rules from the template definition context ([basic.lookup.unqual], [basic.lookup.argdep]). [<em>Note</em>: For the part of the lookup using associated namespaces ([basic.lookup.argdep]), function declarations found in the template instantiation context are found by this lookup, as described in [basic.lookup.argdep]. — <em>end note</em>]</s> If <s>the</s><u>a dependent</u> call<u> ([temp.dep])</u> would be ill-formed or would find a better match had the lookup <s>within the associated namespaces</s><u>for its dependent name</u> considered all the function declarations with external linkage introduced in <s>those</s><u>the associated</u> namespaces in all translation units, not just considering those declarations found in the template definition and template instantiation contexts<u> ([basic.lookup.argdep])</u>, then the program <s>has undefined behavior</s><u>is ill-formed, no diagnostic required</u>.</p>
</blockquote>
<div class="del">
<h4>#[temp.inject]</h4>
</div>
<p>Remove subclause, referring the stable name (which has no surviving cross references) to [temp.friend]. Paragraph 1 is adapted in [temp.friend].</p>
<h3 id="temp.spec">#[temp.spec]</h3>
<p>Change paragraph 3:</p>
<blockquote>
<p>An explicit specialization may be declared for a function template, a variable template, a class template, a member of a class template, or a member template. An explicit specialization declaration is introduced by <code>template&lt;&gt;</code>. In an explicit specialization declaration for a variable template, a class template, a member of a class template<u>,</u> or a class member template, <s>the name of </s>the variable or class that is explicitly specialized shall be <u>specified with </u>a <em>simple-template-id</em>. In the explicit specialization declaration for a function template or a member function template, <s>the name of </s>the function or member function explicitly specialized may be <u>specified using </u>a <em>template-id</em>. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 5:</p>
<blockquote>
<p>For a given template and a given set of <em>template-argument</em>⁠s, 1. an explicit instantiation definition shall appear at most once in a program, 1. an explicit specialization shall be defined at most once in a program, as specified in [basic.def.odr], and 1. both an explicit instantiation and a declaration of an explicit specialization shall not appear in a program unless the explicit <s>instantiation follows a declaration of</s><u>specialization is reachable from</u> the explicit <s>specialization</s><u>instantiation</u>. An implementation is not required to diagnose a violation of this rule<u> if neither declaration is reachable from the other</u>.</p>
</blockquote>
<h4 id="temp.inst">#[temp.inst]</h4>
<p>Change paragraph 2:</p>
<blockquote>
<p>[…] [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>] If <s>a class</s><u>the</u> template<u> selected for the specialization ([temp.class.spec.match])</u> has been declared, but not defined, at the point of instantiation ([temp.point]), the instantiation yields an incomplete class type ([basic.types]). [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>] […]</p>
</blockquote>
<p>Change paragraph 4:</p>
<blockquote>
<p>Unless a member of a <u>templated </u>class<s> template or a member template</s> is a declared specialization,</p>
</blockquote>
<p>Change paragraph 11:</p>
<blockquote>
<p>An implementation shall not implicitly instantiate a function template, a variable template, a member template, a non-virtual member function, <u>or </u>a member class<s>, a</s><u>or</u> static data member of a <u>templated </u>class<s> template</s>, or a substatement of a constexpr if statement ([stmt.if]), unless such instantiation is required. […]</p>
</blockquote>
<p>Remove paragraph 12:</p>
<div class="del">
<blockquote>
<p>Implicitly instantiated class, function, and variable template specializations are placed in the namespace where the template is defined. […]</p>
</blockquote>
</div>
<h4 id="temp.explicit">#[temp.explicit]</h4>
<p>Change paragraph 4:</p>
<blockquote>
<p>If the explicit instantiation is for a class or member class, the <em>elaborated-type-specifier</em> in the <em>declaration</em> shall include a <em>simple-template-id</em>; otherwise, the <em>declaration</em> shall be a <em>simple-declaration</em> whose <em>init-declarator-list</em> comprises a single <em>init-declarator</em> that does not have an <em>initializer</em>. <s>If the explicit instantiation is for a function or member function, the <em>unqualified-id</em> in the <em>declarator</em> shall be either a <em>template-id</em> or, where all template arguments can be deduced, a <em>template-name</em> or <em>operator-function-id</em>. [<em>Note</em>: The declaration may declare a <em>qualified-id</em>, in which case the <em>unqualified-id</em> of the <em>qualified-id</em> must be a <em>template-id</em>. — <em>end note</em>] If the explicit instantiation is for a member function, a member class or a static data member of a class template specialization, the name of the class template specialization in the <em>qualified-id</em> for the member name shall be a <em>simple-template-id</em>.</s> If the explicit instantiation is for a variable template specialization, the <em>unqualified-id</em> in the <em>declarator</em> shall be a <em>simple-template-id</em>. <s>An explicit instantiation shall appear in an enclosing namespace of its template. If the name declared in the explicit instantiation is an unqualified name, the explicit instantiation shall appear in the namespace where its template is declared or, if that namespace is inline ([namespace.def]), any namespace from its enclosing namespace set. [<em>Note</em>: Regarding qualified names in declarators, see [dcl.meaning]. — <em>end note</em>]</s> [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 5:</p>
<blockquote>
<p><u>An explicit instantiation does not introduce a name ([basic.scope.scope]).</u> A declaration of a function template, a variable template, a member function or static data member of a class template, or a member function template of a class or class template shall <s>precede</s><u>be reachable from</u> an<u>y</u> explicit instantiation of that entity. A definition of a class template, a member class of a class template, or a member class template of a class or class template shall <s>precede</s><u>be reachable from</u> an<u>y</u> explicit instantiation of that entity unless <s>the explicit instantiation is preceded by </s>an explicit specialization of the entity with the same template arguments<u> is reachable therefrom</u>. If the <em>declaration</em> of the explicit instantiation names an implicitly-declared special member function ([special]), the program is ill-formed.</p>
</blockquote>
<p>Remove paragraph 8:</p>
<div class="del">
<blockquote>
<p>An explicit instantiation of a class, function template, or variable template specialization is placed in the namespace in which the template is defined. […]</p>
</blockquote>
</div>
<p>Change paragraph 9:</p>
<blockquote>
<p>A trailing <em>template-argument</em> can be left unspecified in an explicit instantiation of a function template specialization or of a member function template specialization provided it can be deduced<s> from the type of a function parameter</s> ([temp.deduct<u>.decl</u>]). <u>If all template arguments can be deduced, the empty template argument list <code>&lt;&gt;</code> may be omitted.</u> [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 11:</p>
<blockquote>
<p>An explicit instantiation that names a class template specialization is also an explicit instantiation of the same kind (declaration or definition) of each of its <u>direct non-template </u>members<s> (not including members inherited from base classes and members that are templates)</s> that has not been previously explicitly specialized in the translation unit containing the explicit instantiation, provided that the associated constraints, if any, of that member are satisfied by the template arguments of the explicit instantiation ([temp.constr.decl], [temp.constr.constr]), except as described below. [<em>Note</em>: In addition, it will typically be an explicit instantiation of certain implementation-dependent data about the class. — <em>end note</em>]</p>
</blockquote>
<p>Change paragraph 13:</p>
<blockquote>
<p>An explicit instantiation of a prospective destructor ([class.dtor]) shall <s>name</s><u>correspond to</u> the selected destructor of the class.</p>
</blockquote>
<h4 id="temp.expl.spec">#[temp.expl.spec]</h4>
<p>Change paragraph 4:</p>
<blockquote>
<p><u>An explicit specialization does not introduce a name ([basic.scope.scope]).</u> A declaration of a function template, class template, or variable template being explicitly specialized shall <s>precede</s><u>be reachable from</u> the declaration of the explicit specialization. [<em>Note</em>: A declaration, but not a definition of the template is required. — <em>end note</em>] The definition of a class or class template shall <s>precede</s><u>be reachable from</u> the declaration of an explicit specialization for a member template of the class or class template. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<p>Change paragraph 5:</p>
<blockquote>
<p>A member function, a member function template, a member class, a member enumeration, a member class template, a static data member, or a static data member template of a class template may be explicitly specialized for a class specialization that is implicitly instantiated; in this case, the definition of the class template shall <s>precede</s><u>be reachable from</u> the explicit specialization for the member of the class template. If such an explicit specialization for the member of a class template names an implicitly-declared special member function ([special]), the program is ill-formed.</p>
</blockquote>
<p>Change paragraph 6:</p>
<blockquote>
<p>A member of an explicitly specialized class is not implicitly instantiated from the member declaration of the class template; instead, the member of the class template specialization shall itself be explicitly defined if its definition is required. <s>In this case, t</s><u>T</u>he definition of the class template explicit specialization shall be <s>in scope at the point at which</s><u>reachable from</u> the <u>definition of any </u>member <s>is defined</s><u>of it</u>. […]</p>
</blockquote>
<p>Remove paragraph 9:</p>
<div class="del">
<blockquote>
<p>A template explicit specialization is in the scope of the namespace in which the template was defined. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
</div>
<p>Change paragraph 11:</p>
<blockquote>
<p>A trailing <em>template-argument</em> can be left unspecified in the <em>template-id</em> naming an explicit function template specialization provided it can be deduced<s> from the function argument type</s><u> ([temp.deduct.decl])</u>. [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<h3 id="temp.fct.spec">#[temp.fct.spec]</h3>
<h4 id="temp.arg.explicit">#[temp.arg.explicit]</h4>
<p>Change paragraph 4:</p>
<blockquote>
<p>Trailing template arguments that can be deduced ([temp.deduct]) or obtained from default <em>template-argument</em>⁠s may be omitted from the list of explicit <em>template-argument</em>⁠s. <u>[<em>Note</em>: </u>A trailing template parameter pack ([temp.variadic]) not otherwise deduced will be deduced as an empty sequence of template arguments.<u> — <em>end note</em>]</u> If all of the template arguments can be deduced, they may all be omitted; in this case, the empty template argument list <code>&lt;&gt;</code> itself may also be omitted. <s>In contexts where deduction is done and fails, or in contexts where deduction is not done, if a template argument list is specified and it, along with any default template arguments, identifies a single function template specialization, then the <em>template-id</em> is an lvalue for the function template specialization.</s> [<em>Example</em>:</p>
<p>[…]</p>
<p>— <em>end example</em>]</p>
</blockquote>
<h4 id="temp.deduct">#[temp.deduct]</h4>
<p>Change example in bullet (11.4):</p>
<blockquote>
[<em>Example</em>:
<pre class="cpp">
template &lt;int I&gt; struct X { };
template &lt;template &lt;class T&gt; class&gt; struct Z { };
template &lt;class T&gt; void f(typename T::Y*){}
template &lt;class T&gt; void g(X&lt;T::N&gt;*){}
template &lt;class T&gt; void h(Z&lt;T::<s>template </s>TT&gt;*){}
struct A {};
struct B { int Y; };
struct C {
  typedef int N;
};
struct D {
  typedef int TT;
};

int main() {
  // Deduction fails in each of these cases:
  f&lt;A&gt;(0);          // A does not contain a member Y
  f&lt;B&gt;(0);          // The Y member of B is not a type
  g&lt;C&gt;(0);          // The N member of C is not a non-type
  h&lt;D&gt;(0);          // The TT member of D is not a template
}
</pre>
<p>— <em>end example</em>]</p>
</blockquote>
<h5 id="temp.deduct.funcaddr">#[temp.deduct.funcaddr]</h5>
<p>Change paragraph 1:</p>
<blockquote>
<p>Template arguments can be deduced from the type specified when taking the address of an overload<s>ed function</s><u> set</u> ([over.over]). […]</p>
</blockquote>
<h5 id="temp.deduct.conv">#[temp.deduct.conv]</h5>
<p>Change paragraph 1:</p>
<blockquote>
<p>Template argument deduction is done by comparing the return type of the conversion function template (call it <code>P</code>) with the type <s>that is required as the result</s><u>specified by the <em>conversion-type-id</em></u> of the <s>conversion</s><u><em>conversion-function-id</em> being looked up</u> (call it <code>A</code><s>; see [dcl.init], [over.match.conv], and [over.match.ref] for the determination of that type</s>) as described in [temp.deduct.type]. <u>If the <em>conversion-function-id</em> is constructed during overload resolution ([over.match.funcs]), the following transformations apply.</u></p>
</blockquote>
<p>Change paragraph 5:</p>
<blockquote>
<p>In general, the deduction process attempts to find template argument values that will make the deduced <code>A</code> identical to <code>A</code>. However, <s>there are four cases that allow a difference</s><u>certain attributes of <code>A</code> may be ignored</u>:</p>
<ol style="list-style-type: decimal">
<li>If the original <code>A</code> is a reference type, <u>any cv-qualifiers of </u><code>A</code><s> can be more cv-qualified than the deduced <code>A</code></s> (i.e., the type referred to by the reference).</li>
<li>If the original <code>A</code> is a function pointer<u> or pointer-to-member-function</u> type, <s><code>A</code> can be “pointer to function” even if the deduced <code>A</code> is “pointer to </s><u>its </u><code>noexcept</code><s> function”</s>.</li>
<li><s>If the original <code>A</code> is a pointer-to-member-function type, <code>A</code> can be “pointer to member of type function” even if the deduced <code>A</code> is “pointer to member of type <code>noexcept</code> function”.</s></li>
<li><s>The deduced</s><u>Any cv-qualifiers in</u> <code>A</code> <s>can be another pointer or pointer-to-member type </s>that can be <s>converted to <code>A</code> via</s><u>restored by</u> a qualification conversion.</li>
</ol>
</blockquote>
<p>Change paragraph 6:</p>
<blockquote>
<p>These <s>alternatives</s><u>attributes</u> are <s>considered</s><u>ignored</u> only if type deduction would otherwise fail. If <s>they yield</s><u>ignoring them allows</u> more than one possible deduced <code>A</code>, the type deduction fails.</p>
</blockquote>
<h4 id="temp.over">#[temp.over]</h4>
<p>Change paragraph 1:</p>
<blockquote>
<p>When a call <s>to the name </s>of a function or function template is written (explicitly, or implicitly using the operator notation), template argument deduction ([temp.deduct]) and checking of any explicit template arguments ([temp.arg]) are performed for each function template to find the template argument values (if any) that can be used with that function template to instantiate a function template specialization that can be invoked with the call arguments<u> or, for conversion function templates, that can convert to the required type</u>. For each function template, if the argument deduction and checking succeeds, the <em>template-argument</em>⁠s (deduced and/or explicit) are used to synthesize the declaration of a single function template specialization which is added to the candidate functions set to be used in overload resolution. If, for a given function template, argument deduction fails or the synthesized function template specialization would be ill-formed, no such function is added to the set of candidate functions for that template. The complete set of candidate functions includes all the synthesized declarations and all of the non-template <s>overloaded </s>functions <s>of the same name</s><u>found by name lookup</u>. The synthesized declarations are treated like any other functions in the remainder of overload resolution, except as explicitly noted in [over.match.best].<sup>[…]</sup></p>
</blockquote>
<h2 id="except">#[except]</h2>
<h3 id="except.handle">#[except.handle]</h3>
<p>Remove paragraph 11:</p>
<div class="del">
<blockquote>
<p>The scope and lifetime of the parameters of a function or constructor extend into the handlers of a <em>function-try-block</em>.</p>
</blockquote>
</div>
<p>Change paragraph 12:</p>
<blockquote>
<p>Exceptions thrown in destructors of objects with static storage duration or in constructors of <s>namespace-scope </s>objects <u>associated with non-block variables </u>with static storage duration are not caught by a <em>function-try-block</em> on the <code>main</code> function ([basic.start.main]). Exceptions thrown in destructors of objects with thread storage duration or in constructors of <s>namespace-scope </s>objects <u>associated with non-block variables </u>with thread storage duration are not caught by a <em>function-try-block</em> on the initial function of the thread.</p>
</blockquote>
<h3 id="except.spec">#[except.spec]</h3>
<p>Change bullet (13.1):</p>
<blockquote>
<p>in an expression, the function is <s>the unique lookup result or the </s>selected <s>member of a set of</s><u>by</u> overload<s>ed functions</s><u> resolution</u> (<s>[basic.lookup], </s>[over.match], [over.over]);</p>
</blockquote>
<h3 id="except.terminate">#[except.terminate]</h3>
<p>Change bullet (1.5):</p>
<blockquote>
<p>when initialization of a non-<s>local</s><u>block</u> variable with static or thread storage duration ([basic.start.dynamic]) exits via an exception, or</p>
</blockquote>
<h2 id="cpp.replace">#[cpp.replace]</h2>
<p>Change paragraph 12:</p>
<blockquote>
<p>[…] The parameters are specified by the optional list of identifiers<s>, whose scope extends from their declaration in the identifier list until the new-line character that terminates the <code>#define</code> preprocessing directive</s>. […]</p>
</blockquote>
<h2 id="concept.booleantestable">#[concept.booleantestable]</h2>
<p>Change paragraph 2:</p>
<blockquote>
<p>Let <code>e</code> be an expression such that <code>decltype((e))</code> is <code>T</code>. <code>T</code> models <em><code>boolean-testable-impl</code></em> only if:</p>
<ol style="list-style-type: decimal">
<li>either <code>remove_cvref_t&lt;T&gt;</code> is not a class type, or <s>name lookup</s><u>a search</u> for the names <code>operator&amp;&amp;</code> and <code>operator||</code> <s>with</s>in the scope of <code>remove_cvref_t&lt;T&gt;</code> <s>as if by class member access lookup ([class.member.lookup]) results in an empty declaration set</s><u>finds nothing</u>; and</li>
<li><s>name</s><u>argument-dependent</u> lookup<u> ([basic.lookup.argdep])</u> for the names <code>operator&amp;&amp;</code> and <code>operator||</code> <s>in the associated namespaces and entities of</s><u>with</u> <code>T</code><s> ([basic.lookup.argdep])</s><u> as the only argument type</u> finds no disqualifying declaration (defined below).</li>
</ol>
</blockquote>
<p>Change bullet (5.2.3):</p>
<blockquote>
<p>the declaration declares a function template <s>that is not visible in its namespace</s><u>to which no name is bound</u> ([<s>namespace.memdef</s><u>dcl.meaning</u>]).</p>
</blockquote>
<h2 id="diff.basic">#[diff.basic]</h2>
<p>Change paragraph 2 (the example is based on that from the removed [class.nested.type]):</p>
<blockquote>
<p><strong>Affected subclause:</strong> [basic.scope]<br /><strong>Change:</strong> A <code>struct</code> is a scope in C++, not in C.<br /><u>For example,</u></p>
<pre class="sourceCode cpp ins"><code class="sourceCode cpp"><span class="kw">struct</span> X {
  <span class="kw">struct</span> Y { <span class="dt">int</span> a; } b;
};
<span class="kw">struct</span> Y c;</code></pre>
<p><u>is valid in C but not in C++, which would require <code>X::Y c;</code>.</u><br /><strong>Rationale:</strong> Class scope is crucial to C++, and a struct is a class.<br /><strong>Effect on original feature:</strong> Change to semantics of well-defined feature.<br /><strong>Difficulty of converting:</strong> Semantic transformation.<br /><strong>How widely used:</strong> C programs use <code>struct</code> extremely frequently, but the change is only noticeable when <code>struct</code>, enumeration, or enumerator names are referred to outside the <code>struct</code>. The latter is probably rare.</p>
</blockquote>
<div class="ins">
<h2>#[depr.template.template]</h2>
<p>Add this subclause before [depr.c.headers]:</p>
<blockquote>
<p>The use of the keyword <code>template</code> before the qualified name of a class or alias template without a template argument list is deprecated.</p>
</blockquote>
</div>
<h1 id="acknowledgments">Acknowledgments</h1>
<p>Thanks to Richard Smith for helping discover and interpret several of the issues addressed and for feedback on their resolutions, and to Rachel Ertl for helping decide on them.</p>
</body>
</html>
