<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[VS2013: Initializer list crashes]]></title><description><![CDATA[<p>Hi,</p>
<p>The following code works <a href="http://ideone.com/ejFMnE" rel="nofollow">here</a>, but crashes in Visual Studio 2013 Preview both in Debug and Release modes (default C++ settings, empty project):</p>
<pre><code>#include&lt;string&gt;
#include&lt;vector&gt;
using namespace std;
int t(vector&lt;string&gt;const&amp;,vector&lt;string&gt;const&amp;v){return v[0][0];}
int main(){t({&quot;&quot;},{&quot;#&quot;}); return 0;}
</code></pre>
<p>Is the code correct or I am doing something wrong?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/318634/vs2013-initializer-list-crashes</link><generator>RSS for Node</generator><lastBuildDate>Mon, 27 Jul 2026 06:56:40 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/318634.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 20 Jul 2013 19:56:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to VS2013: Initializer list crashes on Sat, 20 Jul 2013 20:17:01 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>The following code works <a href="http://ideone.com/ejFMnE" rel="nofollow">here</a>, but crashes in Visual Studio 2013 Preview both in Debug and Release modes (default C++ settings, empty project):</p>
<pre><code>#include&lt;string&gt;
#include&lt;vector&gt;
using namespace std;
int t(vector&lt;string&gt;const&amp;,vector&lt;string&gt;const&amp;v){return v[0][0];}
int main(){t({&quot;&quot;},{&quot;#&quot;}); return 0;}
</code></pre>
<p>Is the code correct or I am doing something wrong?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2340100</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2340100</guid><dc:creator><![CDATA[SAn]]></dc:creator><pubDate>Sat, 20 Jul 2013 20:17:01 GMT</pubDate></item><item><title><![CDATA[Reply to VS2013: Initializer list crashes on Sat, 20 Jul 2013 20:13:00 GMT]]></title><description><![CDATA[<p>Converting &quot;\0&quot; to std::string generates an empty string. Accessing its first element then should be undefined.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2340101</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2340101</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Sat, 20 Jul 2013 20:13:00 GMT</pubDate></item><item><title><![CDATA[Reply to VS2013: Initializer list crashes on Sat, 20 Jul 2013 20:18:47 GMT]]></title><description><![CDATA[<p>Thanks <strong>camper</strong>, but this was not the relevant issue. I have corrected the post.</p>
<p>Should I submit the bug to Microsoft?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2340102</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2340102</guid><dc:creator><![CDATA[SAn]]></dc:creator><pubDate>Sat, 20 Jul 2013 20:18:47 GMT</pubDate></item><item><title><![CDATA[Reply to VS2013: Initializer list crashes on Sat, 20 Jul 2013 21:46:52 GMT]]></title><description><![CDATA[<p>SAn schrieb:</p>
<blockquote>
<p>Should I submit the bug to Microsoft?</p>
</blockquote>
<p>Yes, of course.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2340126</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2340126</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Sat, 20 Jul 2013 21:46:52 GMT</pubDate></item><item><title><![CDATA[Reply to VS2013: Initializer list crashes on Sun, 21 Jul 2013 16:47:22 GMT]]></title><description><![CDATA[<p>That is what I have reported, but I still not sure that the crash in not <em>my</em> fault:<br />
<a href="https://connect.microsoft.com/VisualStudio/feedback/details/794651/c-11-compiler-bug-when-passing-2-initializer-lists-to-a-function" rel="nofollow">https://connect.microsoft.com/VisualStudio/feedback/details/794651/c-11-compiler-bug-when-passing-2-initializer-lists-to-a-function</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2340204</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2340204</guid><dc:creator><![CDATA[SAn]]></dc:creator><pubDate>Sun, 21 Jul 2013 16:47:22 GMT</pubDate></item><item><title><![CDATA[Reply to VS2013: Initializer list crashes on Sun, 21 Jul 2013 18:11:52 GMT]]></title><description><![CDATA[<p>How do you know the <code>initializer_list</code> is the bug source? I'm pretty sure you reported this specific case on purpose, but i don't think that it's essential to provide an unnecessary parameter or the like. I somehow can't believe you really simplified this problem to the root (the code just looks sort of special).</p>
<p>Can you reproduce the same behavior...</p>
<ul>
<li>... without the unnecessary parameter?</li>
<li>... also when creating a temporary explicitly (or some prvalue-vector, initialized with an initializer-list respectively) and passing it to the function?</li>
</ul>
<blockquote>
<p>my fault</p>
</blockquote>
<p>It only is your &quot;fault&quot; if you write code which, by the standard, results in undefined behavior. Everything else* is legal code and <strong>should at least run</strong> just fine. Unfortunately, VC++ has quite a lot of bugs, so...</p>
<p>~*By which i do not include ill-formed code ;)~</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2340223</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2340223</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Sun, 21 Jul 2013 18:11:52 GMT</pubDate></item><item><title><![CDATA[Reply to VS2013: Initializer list crashes on Sun, 21 Jul 2013 18:21:18 GMT]]></title><description><![CDATA[<p><em>Can you reproduce the same behavior without the unnecessary parameter?</em><br />
No. I really cannot simplify the code further.</p>
<p><em>Can you reproduce the same behavior when creating a temporary explicitly (or some prvalue-vector, initialized with an initializer-list respectively) and passing it to the function?</em><br />
No.</p>
<p><em>Unfortunately, VC++ has quite a lot of bugs, so...</em><br />
You see, when there is a contradiction between some standard and Microsoft software, then probably the standard is wrong...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2340227</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2340227</guid><dc:creator><![CDATA[SAn]]></dc:creator><pubDate>Sun, 21 Jul 2013 18:21:18 GMT</pubDate></item><item><title><![CDATA[Reply to VS2013: Initializer list crashes on Sun, 21 Jul 2013 21:17:55 GMT]]></title><description><![CDATA[<p>SAn schrieb:</p>
<blockquote>
<p>You see, when there is a contradiction between some standard and Microsoft software, then probably the standard is wrong...</p>
</blockquote>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> for sure the c++ standard isnt without mistakes. nothing is without mistakes is it. but id kinda blame the MSVC rather blaming the standard, definitely. MSVC sometimes does strange things like binding temporaries to non-const-ref. for that reason alone id blame MSCV for ever and ever. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> yet i dont wanna miss my visual studio. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2340253</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2340253</guid><dc:creator><![CDATA[out]]></dc:creator><pubDate>Sun, 21 Jul 2013 21:17:55 GMT</pubDate></item><item><title><![CDATA[Reply to VS2013: Initializer list crashes on Tue, 23 Jul 2013 18:16:24 GMT]]></title><description><![CDATA[<p>Thay <a href="http://connect.microsoft.com/VisualStudio/feedback/details/794651/c-11-compiler-bug-when-passing-2-initializer-lists-to-a-function" rel="nofollow">say</a> this one is already fixed.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2340704</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2340704</guid><dc:creator><![CDATA[SAn]]></dc:creator><pubDate>Tue, 23 Jul 2013 18:16:24 GMT</pubDate></item></channel></rss>