compiler stack overflow on non-recursive template code - by Mooing Duck

Status : 

  Deferred<br /><br />
		The product team has reviewed this issue and has deferred it for consideration at a later time.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 714003 Comments
Status Closed Workarounds
Type Bug Repros 1
Opened 12/14/2011 9:55:01 AM
Access Restriction Public


I have some relatively simple C++ code that causes the compiler to give up with "fatal error C1063: compiler limit : compiler stack overflow / see reference to class template instantiation 'from<basetype,void,valuetype>' being compiled".

Desc of code below:
The class "base" is a class that holds data.  The class "any" is a abstract template base class, that is specialized for "<void, valuetype>" before the general case, and the general case inherits from "<void, valuetype>".  The class "from" is the implementation of "any", using the data from "base".  The problem comes from the specialization for "<basetype,void,valuetype>", which inherits from "base" and "any<void,valuetype>".

Removing the valuetype template parameter from either class, causes compile to succeed.
Removing the definition of "any<category,valuetype>" (general case), causes compile to succeed.
Removing "base" inheritance from "from<basetype,void,valuetype>" causes code to compile.  <--very odd
Removing "any<void,valuetype>" inheritance from "from<basetype,void,valuetype>" causes code to compile.  
Removing "any<void,valuetype>" inheritance from "any<category,valuetype>" causes code to compile.
Making "from<basetype,void,valuetype>" to be general definition rather than partial specialization causes code to compile.  
gcc-4.3.4 compiles this code just fine:
Sign in to post a comment.
Posted by Microsoft on 3/16/2012 at 12:45 PM
Hi: we are still investigating this bug but unfortunately it does not look like we will be able to fix the underlying issue for the upcoming release of Visual C++ - but we will continue to investigate the bug with the aim to fixing it in a future release.

Jonathan Caves
Visual C++ Compiler Team
Posted by MS-Moderator08 [Feedback Moderator] on 12/14/2011 at 6:50 PM
Thank you for submitting feedback on Visual Studio 2010 and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by MS-Moderator01 on 12/14/2011 at 10:44 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(