Boost C++ Libraries: Ticket #10194: basic_xml_grammar<wchar_t> parses class_id failed https://svn.boost.org/trac10/ticket/10194 <p> I found this issue when I used xml wserialization to save config in polymorphic case. After debugging, I found basic_xml_grammar&lt;wchar_t&gt; failed to parse "class_id" under some conditions. There are some info for this issue: </p> <ol><li>Compile with NDEBUG, without NDEBUG no this issue. </li><li>basic_xml_grammar&lt;char&gt; works fine. </li><li>Compile with GCC (when compile with VS2010, no this issue) </li></ol><p> Detail of GCC: gcc -v Using built-in specs. Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=<a class="ext-link" href="http://bugzilla.redhat.com/bugzilla"><span class="icon">​</span>http://bugzilla.redhat.com/bugzilla</a> --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-<span class="underline">cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux Thread model: posix gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) </span></p> <p> I trimmed the test code: </p> <p> #include &lt;boost/archive/impl/basic_xml_grammar.hpp&gt; #include &lt;fstream&gt; #include &lt;iostream&gt; </p> <p> using namespace boost::archive; </p> <p> int main() { </p> <blockquote> <p> std::wifstream ifs("./dashboard.xml"); </p> </blockquote> <blockquote> <p> if (ifs) { </p> <blockquote> <p> basic_xml_grammar&lt;wchar_t&gt; xmlGrammer; xmlGrammer.parse_start_tag(ifs); </p> </blockquote> </blockquote> <blockquote> <blockquote> <p> std::wcout &lt;&lt; "rv.class_id=" &lt;&lt; xmlGrammer.rv.class_id &lt;&lt; std::endl; </p> </blockquote> <p> } else { </p> <blockquote> <p> std::cout &lt;&lt; "File doesn't exist." &lt;&lt; std::endl; </p> </blockquote> <p> } </p> </blockquote> <blockquote> <p> return 0; </p> </blockquote> <p> } </p> <p> and the dashboard.xml is very simple with only one line: &lt;item class_id="4" class_name="<a class="missing wiki">ComponentDataChart</a>" tracking_level="1" version="4" object_id="_3"&gt; </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10194 Trac 1.4.3 Andrew Xu <xulei.js@…> Tue, 15 Jul 2014 02:48:51 GMT <link>https://svn.boost.org/trac10/ticket/10194#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10194#comment:1</guid> <description> <p> Formatted test code: </p> <pre class="wiki">#include &lt;boost/archive/impl/basic_xml_grammar.hpp&gt; #include &lt;fstream&gt; #include &lt;iostream&gt; using namespace boost::archive; int main() { std::wifstream ifs("./dashboard.xml"); if (ifs) { basic_xml_grammar&lt;wchar_t&gt; xmlGrammer; xmlGrammer.parse_start_tag(ifs); std::wcout &lt;&lt; "rv.class_id=" &lt;&lt; xmlGrammer.rv.class_id &lt;&lt; std::endl; } else { std::cout &lt;&lt; "File doesn't exist." &lt;&lt; std::endl; } return 0; } </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Wed, 23 Jul 2014 21:09:18 GMT</pubDate> <title>component changed; owner set https://svn.boost.org/trac10/ticket/10194#comment:2 https://svn.boost.org/trac10/ticket/10194#comment:2 <ul> <li><strong>owner</strong> set to <span class="trac-author">Robert Ramey</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">serialization</span> </li> </ul> Ticket power_devil@… Fri, 05 Dec 2014 04:19:17 GMT <link>https://svn.boost.org/trac10/ticket/10194#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10194#comment:3</guid> <description> <p> how can u add "class_name" into your xml? my xml is like this: " &lt;item class_id="4" tracking_level="1" version="4" object_id="_3"&gt;", could u help me? thank u very much! </p> </description> <category>Ticket</category> </item> </channel> </rss>