Note that there are some explanatory texts on larger screens.

plurals
  1. POCompiler Bug in Visual C++ 10.0 SP1 - cl.exe version 16.0.40219.1 Access violation [confirmed]
    primarykey
    data
    text
    <p>I have ran into a problem compiling some template code with Visual Stuido 2010 SP1, cl.exe version 16.0.40219.1</p> <p>The following code will cause the compiler to access violate:</p> <pre><code>template&lt;typename T&gt; class A { A(){} }; template&lt;typename T&gt; class B : public A&lt;T&gt; { using A::A(); // Compiler access violates // **EDIT** //using A&lt;T&gt;::A&lt;T&gt;; // Compiler succeeds //using A&lt;T&gt;::A(); // Compiler reports error }; int main(int argc, char* argv[]) { return 0; } </code></pre> <p>It generates the following error (in addition to the "cl.exe has stopped working, C0000005 exception):</p> <pre><code>1&gt;d:\projects\cpptest\cpptest\cpptest.cpp(11): fatal error C1001: An internal error has occurred in the compiler. 1&gt; (compiler file 'msc1.cpp', line 1420) 1&gt; To work around this problem, try simplifying or changing the program near the locations listed above. </code></pre> <p>The code compiles fine (well, that is, it emits a proper error message and doesn't crash the compiler) in Dev-C++ with g++.</p> <pre><code>main.cpp:11: error: `template&lt;class T&gt; class A' used without template parameters main.cpp:11: error: expected nested-name-specifier before "A" main.cpp:11: error: using-declaration for non-member at class scope main.cpp:11: error: expected `;' before '(' token main.cpp:11: error: expected unqualified-id before ')' token make.exe: *** [main.o] Error 1 </code></pre> <p><strong>EDIT</strong> The following, however, compiles fine, without access violation, so it seems this is related to templates:</p> <pre><code>class A { A(){} }; class B : public A { using A::A; }; int main(int argc, char* argv[]) { return 0; } </code></pre> <p>Do you think this is worth reporting to Microsoft? Can anyone else reproduce this? Maybe try in Visual Studio 2013 to see if it still occurs?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload