Home Dashboard Directory Help

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


 as Deferred Help for as Deferred

Sign in
to vote
Type: Bug
ID: 714003
Opened: 12/14/2011 9:55:01 AM
Access Restriction: Public
Moderator Decision: Sent to Engineering Team for consideration
User(s) can reproduce this bug


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: http://ideone.com/Xw9yv
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(http://support.microsoft.com)
Sign in to post a workaround.
Posted by Mooing Duck on 12/14/2011 at 9:59 AM
instead of inheriting from specialized "any<void, valuetype>", make that it's own unrelated class, and inherit from that instead.