<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 3235: parse manipulator without abbreviation is not callable</title>
<meta property="og:title" content="Issue 3235: parse manipulator without abbreviation is not callable">
<meta property="og:description" content="C++ library issue. Status: C++20">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue3235.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#C++20">C++20</a> status.</em></p>
<h3 id="3235"><a href="lwg-defects.html#3235">3235</a>. <code>parse</code> manipulator without abbreviation is not callable</h3>
<p><b>Section:</b> 30.13 <a href="https://wg21.link/time.parse">[time.parse]</a> <b>Status:</b> <a href="lwg-active.html#C++20">C++20</a>
 <b>Submitter:</b> Tomasz Kami&nacute;ski <b>Opened:</b> 2019-07-10 <b>Last modified:</b> 2021-02-25</p>
<p><b>Priority: </b>0
</p>
<p><b>View other</b> <a href="lwg-index-open.html#time.parse">active issues</a> in [time.parse].</p>
<p><b>View all other</b> <a href="lwg-index.html#time.parse">issues</a> in [time.parse].</p>
<p><b>View all issues with</b> <a href="lwg-status.html#C++20">C++20</a> status.</p>
<p><b>Discussion:</b></p>
<p>
The <code>parse</code> overload that does not accept the abbreviation but does accept an offset, 
because the expression in the <i>Remarks:</i> clause:
</p>
<blockquote><pre>
from_stream(declval&lt;basic_istream&lt;charT, traits&gt;*&gt;(), fmt.c_str(), tp, nullptr, &amp;offset)
</pre></blockquote>
<p>
is not valid. This is caused by deduction failure for the <code>basic_string&lt;charT, traits, Alloc&gt;*</code> 
from <code>nullptr</code> (see <a href="https://gcc.godbolt.org/z/ZIjfwV">this link</a>):
</p>

<p><i>[2019-08-17 Issue Prioritization]</i></p>

<p>Status to Tentatively Ready and priority to 0 after six positive votes on the reflector.</p>


<p id="res-3235"><b>Proposed resolution:</b></p>
<p>This wording is relative to <a href="https://wg21.link/n4830">N4830</a>.</p>

<blockquote class="note">
<p>
[<i>Drafting note:</i> As a drive-by fix the <i>Remarks</i> element is also converted to
a <i>Constraints</i> element.]
</p>
</blockquote>

<ol>
<li><p>Modify 30.13 <a href="https://wg21.link/time.parse">[time.parse]</a> as indicated:</p>

<blockquote>
<blockquote><pre>
template&lt;class charT, class traits, class Alloc, class Parsable&gt;
  <i>unspecified</i>
    parse(const basic_string&lt;charT, traits, Alloc&gt;&amp; fmt, Parsable&amp; tp,
          minutes&amp; offset);
</pre></blockquote>
<p>
-6- <i><del>Remarks</del><ins>Constraints</ins>:</i> <del>This function shall not participate in 
overload resolution unless</del><ins>The expression</ins> 
</p>
<blockquote><pre>
from_stream(declval&lt;basic_istream&lt;charT, traits&gt;&amp;&gt;(), fmt.c_str(), tp, 
  <ins>declval&lt;basic_string&lt;charT, traits, Alloc&gt;*&gt;()</ins><del>nullptr</del>, &amp;offset)
</pre></blockquote>
<p>
is <del>a valid</del><ins>well-formed</ins> <del>expression</del><ins>when treated as an unevaluated operand</ins>.
<p/>
-7- <i>Returns:</i> A manipulator that, when extracted from a <code>basic_istream&lt;charT, traits&gt; is</code>, 
calls <code>from_stream(is, fmt.c_str(), tp, <ins>static_cast&lt;basic_string&lt;charT, traits,
Alloc&gt;*&gt;(</ins>nullptr<ins>)</ins>, &amp;offset)</code>.
</p>
</blockquote>
</li>
</ol>




</body>
</html>
