[Boost-bugs] [Boost C++ Libraries] #9619: Deserialization of deep object tree fails on VS2012 when a templated function is called in the same cpp file

Subject: [Boost-bugs] [Boost C++ Libraries] #9619: Deserialization of deep object tree fails on VS2012 when a templated function is called in the same cpp file
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-01-30 16:01:52


#9619: Deserialization of deep object tree fails on VS2012 when a templated
function is called in the same cpp file
-------------------------------------------+---------------------------
 Reporter: Yodan Tauber <yodan.tauber@…> | Owner: ramey
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: serialization
  Version: Boost 1.55.0 | Severity: Problem
 Keywords: |
-------------------------------------------+---------------------------
 When using Visual Studio 2012, error C2996 ("recursive function template
 definition") is reported by the compiler when all of the following
 conditions apply:
 1. A C++ object is deserialized using Boost Serialization somewhere in the
 *.cpp file.
 2. The serialized object is "deep enough" (~5 levels - i.e. A contains a
 vector of B, B contains a vector of C, etc. until E).
 3. Somewhere in the same *.cpp file (not necessarily in the same
 function), some templated function is called.

 The error is no longer reported if the object is changed to be more
 "shallow".
 The error is no longer reported if the call to the templated function is
 removed.

 This error does not reproduce in VS2010. It occurs in VS2012 as well as
 VS2013.
 Tested with Boost versions 1.49, 1.52, 1.55 - same problem.

 Note: while this may be caused by an underlying bug in VS2012 (and I have
 opened an issue with Microsoft Connect regarding this), I think we need a
 workaround within Boost, as the chances that Microsoft will fix this are
 slim at best.

 Note: about to attach a cpp file which reproduces the problem.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9619>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:15 UTC