public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59457] New: name mangling in presence of variadic templates seems wrong
@ 2013-12-10 20:46 plasmahh at gmx dot net
  2013-12-10 20:50 ` [Bug c++/59457] " ville.voutilainen at gmail dot com
  0 siblings, 1 reply; 2+ messages in thread
From: plasmahh at gmx dot net @ 2013-12-10 20:46 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59457

            Bug ID: 59457
           Summary: name mangling in presence of variadic templates seems
                    wrong
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: plasmahh at gmx dot net

With the program below, the output is

1hI1AI2hhIiEEE
h<A<hh<int> > >
h<A, hh<int> >

where the "h<A, hh<int> >" part is from my "hand-mangled" idea how it should
look like. It seems to be only present when variadic templates are there, e.g.
when you replace class... with class, it goes away. Clang btw. seems to mangle
it correctly, that is with J in place of I.


    #include <iostream>
    #include <typeinfo>
    #include <cxxabi.h>

    struct A{};
    template<class,class...> struct h{};
    template<class> struct hh{};
    int main() {
    typedef h<A,hh<int>> hx;
    const char* name = typeid(hx).name();
    std::cout << name << "\n";
    char db[4096];
    size_t size = 4096;
    int st;
    abi::__cxa_demangle(name,db,&size,&st);
    std::cout << db << "\n";
    // now what I think the symbol should look like (exchange
    abi::__cxa_demangle("1hI1AJ2hhIiEEE",db,&size,&st);
    std::cout << db << "\n";
    return 0;
    }


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/59457] name mangling in presence of variadic templates seems wrong
  2013-12-10 20:46 [Bug c++/59457] New: name mangling in presence of variadic templates seems wrong plasmahh at gmx dot net
@ 2013-12-10 20:50 ` ville.voutilainen at gmail dot com
  0 siblings, 0 replies; 2+ messages in thread
From: ville.voutilainen at gmail dot com @ 2013-12-10 20:50 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59457

Ville Voutilainen <ville.voutilainen at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ville.voutilainen at gmail dot com

--- Comment #1 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
The result is the same with 4.9 and 4.7.2, so this bug has been there for quite
some time.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-12-10 20:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-10 20:46 [Bug c++/59457] New: name mangling in presence of variadic templates seems wrong plasmahh at gmx dot net
2013-12-10 20:50 ` [Bug c++/59457] " ville.voutilainen at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).