Error C1001: An internal error has occurred in the compiler
<p>I have a virtual function inside a C++ templated task, and when it is compiled in Visual Studio 2015 (I have tried all combinations of Debug/Release and x86/x64), it consistently fails with compiler error C1001 on the following line of code:</p>

<pre><code>e_Ty *d(new e_Ty[l]);
</code></pre>

<p>Where <code>e_Ty</code> is the template parameter of the class. This error only occurs when I use the template class with <code>e_Ty</code> set to <code>std::pair&lt;const int &amp;, int &amp;&gt;</code>. Is there a legitimate reason why this should not work, or is this a bug in MSVC?
<hr/>
<strong>EDIT</strong></p>

<p>Notes:</p>

<ul>
<li><code>l</code> is a local variable that was declared (and assigned a value as a result of a function call) ahead of time.</li>
<li>I have tried using disabling optimization, using <code>auto</code>, and using assignment-style initialization, none of which worked.</li>
<li>Code compiles fine when <code>e_Ty</code> is <code>int</code>.</li>
</ul>