Subject: [Boost-bugs] [Boost C++ Libraries] #4453: is_virtual_base_of uses common names for internal types (X and Y); naming conflicts result
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-07-19 22:41:33
#4453: is_virtual_base_of uses common names for internal types (X and Y); naming
conflicts result
------------------------------------------------+---------------------------
Reporter: Karl Voelker <ktvoelker@â¦> | Owner: johnmaddock
Type: Bugs | Status: new
Milestone: To Be Determined | Component: type_traits
Version: Boost Development Trunk | Severity: Problem
Keywords: |
------------------------------------------------+---------------------------
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.)
I've attached a simple demonstration of the problem. I attempted to
compile with: g++ -c MyDerived.cpp.
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.
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.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/4453> 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:03 UTC