Boost C++ Libraries: Ticket #2792: HP aCC rejects string_parse_tree <> in string_parse_tree.hpp https://svn.boost.org/trac10/ticket/2792 <p> When trying to use date_time's format_date_parser&lt;&gt; I get errors on string_parse_tree&lt;&gt; template instantiation. The error message says "incomplete type is not allowed", the exact compiler version is HP C/aC++ B3910B A.06.20. </p> <p> The core reason for the error is that string_parse_tree&lt;&gt; includes the definition of "ptree_coll" and several typedefs above it: </p> <p> template&lt;typename charT&gt; struct string_parse_tree { </p> <blockquote> <p> ... typedef std::multimap&lt;charT, string_parse_tree &gt; ptree_coll; ... typedef typename ptree_coll::value_type value_type; typedef typename ptree_coll::iterator iterator; ... ptree_coll m_next_chars; .. </p> </blockquote> <p> }; </p> <p> AFAIK this is not guaranteed to work by the current C++ standard, because string_parse_tree&lt;&gt; is, generally speaking, incomplete at the point of instantiation of ptree_coll. </p> <p> I asked at comp.lang.c++.moderated, and these are the replies: </p> <p> <a class="ext-link" href="http://groups.google.ru/group/comp.lang.c++.moderated/browse_thread/thread/f04915083b8f0f93/a11c78689cffb71b"><span class="icon">​</span>http://groups.google.ru/group/comp.lang.c++.moderated/browse_thread/thread/f04915083b8f0f93/a11c78689cffb71b</a> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2792 Trac 1.4.3 Stuart A. Malone <samalone@…> Mon, 30 Apr 2012 19:51:20 GMT <link>https://svn.boost.org/trac10/ticket/2792#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2792#comment:1</guid> <description> <p> I believe I am seeing the same problem with Boost 1.49 under the Xcode 4.4 developer preview 3 using the Apple LLVM compiler 4.0 and libc++ (LLVM C++ standard library with C++11 support. The string_parse_tree class is relying on undefined behavior when it attempts to use itself in the definition of ptree_coll. </p> <p> I had a similar problem in my own code when I switched to this compiler/library combination, and solved it by using boost::shared_ptr to store a pointer to the sub-object rather than storing the complete object. </p> </description> <category>Ticket</category> </item> <item> <author>andrew.c.morrow@…</author> <pubDate>Sat, 14 Jul 2012 00:08:47 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/2792 https://svn.boost.org/trac10/ticket/2792 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">fix.2792.patch</span> </li> </ul> <p> Use shared_ptr to build tree, rather than by size self reference. </p> Ticket andrew.c.morrow@… Sat, 14 Jul 2012 00:09:41 GMT <link>https://svn.boost.org/trac10/ticket/2792#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2792#comment:2</guid> <description> <p> I can confirm that this problem exists with Boost 1.50 under XCode 4.5 Developer Preview 2 when building boost with clang++. I've attached a very minimally tested patch against SVN 79489 that implements the shared_ptr fix mentioned by samalome above. </p> </description> <category>Ticket</category> </item> <item> <author>andrew.c.morrow@…</author> <pubDate>Sat, 14 Jul 2012 17:47:27 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/2792 https://svn.boost.org/trac10/ticket/2792 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">fix.2792.svn.patch</span> </li> </ul> <p> a better patch made via "svn diff" </p> Ticket andrew.c.morrow@… Sun, 15 Jul 2012 16:12:49 GMT milestone changed https://svn.boost.org/trac10/ticket/2792#comment:3 https://svn.boost.org/trac10/ticket/2792#comment:3 <ul> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.39.0</span> → <span class="trac-field-new">Boost 1.51.0</span> </li> </ul> Ticket andrew.c.morrow@… Wed, 18 Jul 2012 19:09:35 GMT attachment set https://svn.boost.org/trac10/ticket/2792 https://svn.boost.org/trac10/ticket/2792 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">fix.2792.new.patch</span> </li> </ul> <p> Re-uploading, something seems wrong with the previous upload </p> Ticket andrew.c.morrow@… Fri, 27 Jul 2012 14:36:48 GMT <link>https://svn.boost.org/trac10/ticket/2792#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2792#comment:4</guid> <description> <p> Ping? I'd really like to see this fixed for boost 1.51, but my updates in this ticket seem to have not generated much attention. This is a long standing problem in boost date_time and it breaks boost with recent versions of clang. I'm willing to help out with getting it fixed for the upcoming release. What can I do to help? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 28 Nov 2012 04:55:22 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2792#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2792#comment:5</guid> <description> <p> I'm also seeing this problem in clang 4.1, Boost 1.52. Patch appears to work. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sun, 10 Mar 2013 17:27:15 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/2792#comment:6 https://svn.boost.org/trac10/ticket/2792#comment:6 <ul> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.51.0</span> → <span class="trac-field-new">To Be Determined</span> </li> </ul> Ticket