This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Next round of new demangler patches


Gabriel Dos Reis <gdr@integrable-solutions.net> writes:

> Ian Lance Taylor <ian@airs.com> writes:
> 
> | These patches to the new demangler fix two problems pointed out by
> | Michael Elizabeth Chastain.
> | 
> | The first problem is that when a constructor/destructor is defined for
> | a class which is itself a standard substitution, the demangler would
> | use the short name without the template arguments, which led to things
> | like std::string::~string(), which can be confusing since std::string
> | is an abbreviation for a specialization of basic_string<>, so the
> | actual function is named basic_string().
> 
> Oh, I would really prefer std::string::~string() over
> std::string::~basic_string(), for the same reason I would prefer 
> std::string::string() over  std::string::basic_string() -- even more, 
> the standard explicitly says that T::T names a constructor (I would
> think, not I have not checked, that T::~T names the destructor).

Well, sure, std::string::~basic_string() would be even more bogus than
std::string::~string().

What the demangler will now produce is
    std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()

That is, the demangler will skip the simplification of
    std::basic_string<char, std::char_traits<char>, std::allocator<char> >
to std::string in this particular case.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]