<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>157452</bug_id>
          
          <creation_ts>2016-05-07 09:52:30 -0700</creation_ts>
          <short_desc>NeverDestroyed&lt;&gt; constructor does not pass std::initializer_list correctly</short_desc>
          <delta_ts>2017-07-21 20:23:35 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Template Framework</component>
          <version>Other</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>132348</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jer Noble">jer.noble</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>darin</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1190939</commentid>
    <comment_count>0</comment_count>
      <attachid>278325</attachid>
    <who name="Jer Noble">jer.noble</who>
    <bug_when>2016-05-07 09:52:30 -0700</bug_when>
    <thetext>Created attachment 278325
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 &apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1331263</commentid>
    <comment_count>1</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2017-07-21 20:23:35 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 132348 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>278325</attachid>
            <date>2016-05-07 09:52:30 -0700</date>
            <delta_ts>2016-05-07 09:52:30 -0700</delta_ts>
            <desc>TestCase.cpp</desc>
            <filename>NeverDestroyedInitializerList.cpp</filename>
            <type>application/octet-stream</type>
            <size>156</size>
            <attacher name="Jer Noble">jer.noble</attacher>
            
              <data encoding="base64">I2luY2x1ZGUgPHd0Zi9OZXZlckRlc3Ryb3llZC5oPgojaW5jbHVkZSA8d3RmL1ZlY3Rvci5oPgoK
aW50IG1haW4oKQp7CglWZWN0b3I8aW50PiB2MSA9IHsxLCAyLCAzfTsKCU5ldmVyRGVzdHJveWVk
PFZlY3RvcjxpbnQ+PiB2MiA9IHsxLCAyLCAzfTsKCXJldHVybiAwOwp9
</data>

          </attachment>
      

    </bug>

</bugzilla>