public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "plasmahh at gmx dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/59457] New: name mangling in presence of variadic templates seems wrong
Date: Tue, 10 Dec 2013 20:46:00 -0000	[thread overview]
Message-ID: <bug-59457-4@http.gcc.gnu.org/bugzilla/> (raw)

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;
    }


             reply	other threads:[~2013-12-10 20:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-10 20:46 plasmahh at gmx dot net [this message]
2013-12-10 20:50 ` [Bug c++/59457] " ville.voutilainen at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-59457-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).