<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - NeverDestroyed&lt;&gt; constructor does not pass std::initializer_list correctly"
   href="https://bugs.webkit.org/show_bug.cgi?id=157452">157452</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>NeverDestroyed&lt;&gt; constructor does not pass std::initializer_list correctly
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Web Template Framework
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>jer.noble&#64;apple.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=278325" name="attach_278325" title="TestCase.cpp">attachment 278325</a> <a href="attachment.cgi?id=278325&amp;action=edit" title="TestCase.cpp">[details]</a></span>
TestCase.cpp

The following code fails to compile:

#include &lt;wtf/NeverDestroyed.h&gt;
#include &lt;wtf/Vector.h&gt;

int main()
{
    Vector&lt;int&gt; v1 = {1, 2, 3}; // OK
    NeverDestroyed&lt;Vector&lt;int&gt;&gt; v2 = {1, 2, 3}; // &quot;error: no matching constructor for initialization of 'WTF::Vector&lt;int, 0, WTF::CrashOnOverflow, 16&gt;&quot;
    return 0;
}

This is likely because the &quot;std::forward&lt;Args&gt;(args)...&quot; in the NeverDestroyed constructor unrolls the initializer_list into a sequence of parameters, rather than passing it unadulterated.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>