Opened 5 years ago
Last modified 5 years ago
#13270 new Bugs
BOOST_CLASS_EXPORT(some_template<>) fails to load pointers
| Reported by: | Owned by: | Robert Ramey | |
|---|---|---|---|
| Milestone: | To Be Determined | Component: | serialization |
| Version: | Boost 1.65.0 | Severity: | Regression |
| Keywords: | Cc: |
Description
After upgrading from 1.56.0 to 1.65.1 loading pointers with xml_warchive to a template with default template arguments no longer works.
BOOST_EXPORT_CLASS(some_template<>)
ptr *some_base_class;
ar & make_nvp("ptr", ptr);
Saving works okay, loading fails => the type cannot be found.
The problem seems to be related to the <> characters in the default template argument of the BOOST_CLASS_EXPORT. Debugging the serialization code I see that the serialization internal key[] now reads some_template<<>. Note the "<" and the "<" character. I haven't checked 1.56.0, but my guess is that it was probably some_template<>.
At any rate, having << is definitely wrong, as < is, of course, escaped <.
Changing BOOST_CLASS_EXPORT to BOOST_CLASS_EXPORT_GUID and specifying the correct key seems to work okay.

This is under Windows 7, Visual Studio 2013, x64 Compilation.