<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 3678: Constructors of std::chrono::time_zone might be overly unspecified</title>
<meta property="og:title" content="Issue 3678: Constructors of std::chrono::time_zone might be overly unspecified">
<meta property="og:description" content="C++ library issue. Status: New">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue3678.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#New">New</a> status.</em></p>
<h3 id="3678"><a href="lwg-active.html#3678">3678</a>. Constructors of <code>std::chrono::time_zone</code> might be overly unspecified</h3>
<p><b>Section:</b> 30.11.5.1 <a href="https://wg21.link/time.zone.overview">[time.zone.overview]</a> <b>Status:</b> <a href="lwg-active.html#New">New</a>
 <b>Submitter:</b> Jiang An <b>Opened:</b> 2022-02-23 <b>Last modified:</b> 2025-03-19</p>
<p><b>Priority: </b>4
</p>
<p><b>View all issues with</b> <a href="lwg-status.html#New">New</a> status.</p>
<p><b>Discussion:</b></p>
<p>
In 30.11.5.1 <a href="https://wg21.link/time.zone.overview">[time.zone.overview]</a>, only defaulted move constructor and move assignment operator for 
<code>std::chrono::time_zone</code> are shown, other constructors are said to be "unspecified additional constructors". 
Presumably the intent is that the default constructor is not declared (suppressed) and the copy constructor is 
implicitly deleted, but it is not clear if they are not "unspecified additional constructors" and hence 
implicitly specified.
<p/>
On the other hand, the defaulted definitions of move functions bring almost no specification, as no exposition 
only member is shown. So it is unspecified whether these functions are deleted, trivial, <code>constexpr</code>, 
or <code>noexcept</code>. Perhaps we want these functions to be non-deleted and <code>noexcept</code>, while triviality 
and <code>constexpr</code>-ness should be left unspecified.
</p>

<p><i>[2022-03-04; Reflector poll]</i></p>

<p>
Set priority to 4 after reflector poll.
</p>

<p><i>[2025-03-18; Jonathan provides wording]</i></p>

<p>
I don't think it matters whether they are trivial or constexpr, because they
cannot be used. Users only have access to <code class='backtick'>const time_zone</code> lvalues via
<code class='backtick'>locate_zone</code> and the <code class='backtick'>tzdb::zones</code> container.
The move constructor and move assignment operator only need to exist so that
the implementation can populate that container.
</p>



<p id="res-3678"><b>Proposed resolution:</b></p>
<p>
This wording is relative to <a href="https://wg21.link/N5001" title=" Working Draft, Programming Languages — C++">N5001</a>.
</p>

<ol>
<li><p>Modify 30.11.5.1 <a href="https://wg21.link/time.zone.overview">[time.zone.overview]</a> as indicated:</p>
<blockquote><pre><code>
namespace std::chrono {
  class time_zone {
    <ins>time_zone(<i>unspecified</i>);</ins>
  public:
    time_zone(time_zone&amp;&amp;) = default;
    time_zone&amp; operator=(time_zone&amp;&amp;) = default;

    <del><i>// unspecified additional constructors</i></del>

    <i>[...]</i>
  };
}</code></pre></blockquote>
<p>-1-
A <code class='backtick'>time_zone</code> represents all time zone transitions for a specific geographic
area.
<code class='backtick'>time_zone</code> construction is unspecified, and performed
<ins>only</ins>
as part of database initialization.
</p>
<p>
[<i>Note 1</i>:
<code class='backtick'>const time_zone</code> objects can be accessed via functions such as <code class='backtick'>locate_zone</code>.
&mdash; <i>end note</i>]
</p>
</li>
</ol>





</body>
</html>
