Boost C++ Libraries: Ticket #4453: is_virtual_base_of uses common names for internal types (X and Y); naming conflicts result https://svn.boost.org/trac10/ticket/4453 <p> is_virtual_base_of (and probably a lot of other type traits, I suspect) uses some structs internally, X and Y, which inherit from the types being analyzed. But if the derived type under analysis (from which Y inherits) has a method Y, the constructor Y::Y in the internal struct becomes a problem. (At least, under gcc 4.5.0 20100520 prerelease.) </p> <p> I've attached a simple demonstration of the problem. I attempted to compile with: g++ -c <a class="missing wiki">MyDerived</a>.cpp. </p> <p> One obvious solution to this problem is to change X and Y to have bizarre names that are unlikely to conflict with user code. I have attached a patch to this effect. However, I suspect that this problem occurs in many other type traits. </p> <p> I'm not enough of a C++ spec expert to say whether my program ought to compile or not. Sorry. The real-world case from which my example was distilled is known to compile on MSVC++. I do not have access to MSVC++ to test my distillation. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4453 Trac 1.4.3 Karl Voelker <ktvoelker@…> Mon, 19 Jul 2010 22:42:00 GMT attachment set https://svn.boost.org/trac10/ticket/4453 https://svn.boost.org/trac10/ticket/4453 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">fix.patch</span> </li> </ul> <p> Patch for the problem </p> Ticket Karl Voelker <ktvoelker@…> Mon, 19 Jul 2010 22:42:22 GMT attachment set https://svn.boost.org/trac10/ticket/4453 https://svn.boost.org/trac10/ticket/4453 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-tt-bug.tar</span> </li> </ul> <p> Example of the problem </p> Ticket Karl Voelker <ktvoelker@…> Mon, 19 Jul 2010 22:44:16 GMT attachment set https://svn.boost.org/trac10/ticket/4453 https://svn.boost.org/trac10/ticket/4453 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">out.txt</span> </li> </ul> <p> My compiler output for the example </p> Ticket John Maddock Thu, 22 Jul 2010 10:06:24 GMT status changed https://svn.boost.org/trac10/ticket/4453#comment:1 https://svn.boost.org/trac10/ticket/4453#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket John Maddock Thu, 22 Jul 2010 10:29:52 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/4453#comment:2 https://svn.boost.org/trac10/ticket/4453#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/64251" title="Mangle the names of internal classes so they're less likely to ...">[64251]</a>) Mangle the names of internal classes so they're less likely to conflict with derived class names and members. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4453" title="#4453: Bugs: is_virtual_base_of uses common names for internal types (X and Y); ... (closed: fixed)">#4453</a>. </p> Ticket