Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix demangling template parameter packs #414

Merged

Conversation

tanderson-google
Copy link
Contributor

@tanderson-google tanderson-google commented Jan 2, 2019

Clang 4.0.1-10 and gcc 7.3.0 both mangle the function "void add<int>(int)" as
"_Z3addIJiEEvDpT_". The template parameter pack is of the form
J <template-arg>* E

The opening character for a param pack could be either I or J, as libiberty
follows [1]. This change simply adds the J case.

[1] https://github.com/gcc-mirror/gcc/blob/fbd263526ad105a953fd51d9f7bca2c3f268cf82/libiberty/cp-demangle.c#L3209

Clang 4.0.1-10 and gcc 7.3.0 both mangle the function "void add<int>(int)" as
"_Z3addIJiEEvDpT_".  The template parameter pack is of the form
J <template-arg>* E

The opening character for a param pack could be either I or J, as libiberty
follows [1].  This change simply adds the J case.

[1] https://github.com/gcc-mirror/gcc/blob/fbd263526ad105a953fd51d9f7bca2c3f268cf82/libiberty/cp-demangle.c#L3209
Copy link
Contributor

@hlsyounes hlsyounes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about adding the examples to demangle_unittest.txt instead? Then they would be tested by the FromFile test case.

@hlsyounes
Copy link
Contributor

I believe this should fix #14 too. The mangled strings all have "J" in them in that issue. This is different from #50, which would have "B" in the mangled strings.

@tanderson-google
Copy link
Contributor Author

How about adding the examples to demangle_unittest.txt instead? Then they would be tested by the FromFile test case.

Done

@tanderson-google
Copy link
Contributor Author

Thanks for the review. Could you also merge this for me? I don't think I have permission to do it myself

@hlsyounes
Copy link
Contributor

I don't have permission either. I think you need one of the members in this group to do the merge:
https://github.com/orgs/google/teams/glog/members

I'll ping them, since I have a pull request of my own that fixes the other outstanding issue with the demangle unit test.

@ukai ukai merged commit 7fcb278 into google:master Jan 7, 2019
durswd pushed a commit to durswd/glog that referenced this pull request Sep 2, 2019
* Fix demangling template parameter packs

Clang 4.0.1-10 and gcc 7.3.0 both mangle the function "void add<int>(int)" as
"_Z3addIJiEEvDpT_".  The template parameter pack is of the form
J <template-arg>* E

The opening character for a param pack could be either I or J, as libiberty
follows [1].  This change simply adds the J case.

[1] https://github.com/gcc-mirror/gcc/blob/fbd263526ad105a953fd51d9f7bca2c3f268cf82/libiberty/cp-demangle.c#L3209
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants