<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 3239: Hidden friends should be specified more narrowly</title>
<meta property="og:title" content="Issue 3239: Hidden friends should be specified more narrowly">
<meta property="og:description" content="C++ library issue. Status: Resolved">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue3239.html">
<meta property="og:type" content="website">
<meta property="og:image" content="http://cplusplus.github.io/LWG/images/cpp_logo.png">
<meta property="og:image:alt" content="C++ logo">
<style>
  p {text-align:justify}
  li {text-align:justify}
  pre code.backtick::before { content: "`" }
  pre code.backtick::after { content: "`" }
  blockquote.note
  {
    background-color:#E0E0E0;
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 1px;
    padding-bottom: 1px;
  }
  ins {background-color:#A0FFA0}
  del {background-color:#FFA0A0}
  table.issues-index { border: 1px solid; border-collapse: collapse; }
  table.issues-index th { text-align: center; padding: 4px; border: 1px solid; }
  table.issues-index td { padding: 4px; border: 1px solid; }
  table.issues-index td:nth-child(1) { text-align: right; }
  table.issues-index td:nth-child(2) { text-align: left; }
  table.issues-index td:nth-child(3) { text-align: left; }
  table.issues-index td:nth-child(4) { text-align: left; }
  table.issues-index td:nth-child(5) { text-align: center; }
  table.issues-index td:nth-child(6) { text-align: center; }
  table.issues-index td:nth-child(7) { text-align: left; }
  table.issues-index td:nth-child(5) span.no-pr { color: red; }
  @media (prefers-color-scheme: dark) {
     html {
        color: #ddd;
        background-color: black;
     }
     ins {
        background-color: #225522
     }
     del {
        background-color: #662222
     }
     a {
        color: #6af
     }
     a:visited {
        color: #6af
     }
     blockquote.note
     {
        background-color: rgba(255, 255, 255, .10)
     }
  }
</style>
</head>
<body>
<hr>
<p><em>This page is a snapshot from the LWG issues list, see the <a href="lwg-active.html">Library Active Issues List</a> for more information and the meaning of <a href="lwg-active.html#Resolved">Resolved</a> status.</em></p>
<h3 id="3239"><a href="lwg-defects.html#3239">3239</a>. Hidden friends should be specified more narrowly</h3>
<p><b>Section:</b> 17.12.2.2 <a href="https://wg21.link/cmp.partialord">[cmp.partialord]</a>, 17.12.2.3 <a href="https://wg21.link/cmp.weakord">[cmp.weakord]</a>, 17.12.2.4 <a href="https://wg21.link/cmp.strongord">[cmp.strongord]</a>, 31.12.6 <a href="https://wg21.link/fs.class.path">[fs.class.path]</a>, 23.2.5.1 <a href="https://wg21.link/container.node.overview">[container.node.overview]</a> <b>Status:</b> <a href="lwg-active.html#Resolved">Resolved</a>
 <b>Submitter:</b> Daniel Sunderland <b>Opened:</b> 2019-07-19 <b>Last modified:</b> 2021-06-06</p>
<p><b>Priority: </b>Not Prioritized
</p>
<p><b>View all issues with</b> <a href="lwg-status.html#Resolved">Resolved</a> status.</p>
<p><b>Discussion:</b></p>
<p>
LWG has been moving papers which use hidden friends to restrict an entity's lookup to be via ADL only.
However, the current wording does not prevent an implementation from making these entities from also
being available via (un)qualified lookup.
<p/>
Walter Brown and I have an unreviewed paper (<a href="https://wg21.link/p1601r0">P1601R0</a>) in the
Post Kona mailing specifying that entities which are intended to be found via ADL only include a
<i>Remarks</i> element which states something equivalent to the following:
<p/>
"Remarks: This function is to be found via argument-dependent lookup only."
<p/>
Adding this element after the draft ships will be a semantic change. Marshall suggested that I file
an LWG issue to add/modify <i>Remarks</i> elements where needed to prevent (un)qualified lookup.
<p/>
The following stable names are places in the pre Cologne draft (<a href="https://wg21.link/n4820">N4820</a>)
which potentially use hidden friends. Furthermore, there are papers that LWG added to the straw polls
which also potentially use hidden friends. LWG should review each of these subsections/papers to determine
if they should include the text equivalent to the <i>Remarks</i> above. [<i>Note:</i> Not all these
subsections should restrict lookup to ADL only. It is very likely that I missed a paper or subsection
&mdash; <i>end note</i>].
</p>
<ul>
<li><p> [cmp.weakeq]: Comparisons</p></li>
<li><p> [cmp.strongeq]: Comparisons</p></li>
<li><p>17.12.2.2 <a href="https://wg21.link/cmp.partialord">[cmp.partialord]</a>: Comparisons</p></li>
<li><p>17.12.2.3 <a href="https://wg21.link/cmp.weakord">[cmp.weakord]</a>: Comparisons</p></li>
<li><p>17.12.2.4 <a href="https://wg21.link/cmp.strongord">[cmp.strongord]</a>: Comparisons</p></li>
<li><p>31.12.6 <a href="https://wg21.link/fs.class.path">[fs.class.path]</a>: <code>operator&lt;&lt;</code>, <code>operator&gt;&gt;</code></p></li>
<li><p>23.2.5.1 <a href="https://wg21.link/container.node.overview">[container.node.overview]</a>: <code>swap</code></p></li>
<li><p><a href="https://wg21.link/p0660r10">P0660R10 (Stop Token and Joining Thread)</a>:
Comparisons, <code>swap</code></p></li>
<li><p><a href="https://wg21.link/p1614r2">P1614R2 (The Mothership has Landed)</a>: Comparisons</p></li>
</ul>

<p><i>[2019-11-17; Daniel comments]</i></p>

<p>
The acceptance of <a href="https://wg21.link/p1965r0">P1965R0</a> at the Belfast 2019 meeting
should resolve this issue.
</p>
<p><i>[2019-11; Resolved by the adoption of P1965 in Belfast]</i></p>



<p id="res-3239"><b>Proposed resolution:</b></p>




</body>
</html>
