-
Notifications
You must be signed in to change notification settings - Fork 97
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
clang++/g++ disagree on how template arguments in substitutions are resolved #68
Comments
I suspect the same problem could occur with function parameter references, though an example would have to be very complicated. |
The original mangled name is invalid. The right way to refer to We can reach cases that demonstrate the problem in question with an example like this:
Everyone mangles this as In summary, Clang, GCC, ICC, and the libstdc++ demangler all agree that when a |
That's great news. I hope you're able to update the spec text to clarify that. |
For the record, the real-life issue that triggered this bug report was:
while Perhaps that version of clang++ mangled the symbol incorrectly. I would have tried to come up with a minimal C++ testcase but I'm not adept at taking a symbol like that and reverse-engineering some minimal C++ code that produces it... |
I hope someone fixes this. Once that's fixed, it'll be interesting to see if that changes |
Basically the question is: when a template parameter reference like
T_
occurs in a substitution, is the reference looked up in the template instance where the substitution is defined, or where it is used?It appears that
llvm-cxxfilt
assumes the former, butc++filt
assumes the latter. Consider the (hand-written) mangled symbol_Z5helloIXadL_Z6ignoreI9RangitotoEvT_EEEvS2_
:In this case both tools agree that the
S2_
substitution refers to theT_
, but they disagree on what that expands to.To my reading, the spec isn't clear on this issue. The most relevant text I can find is
which suggests the definition instance is preferred, which also seems logical to me.
The text was updated successfully, but these errors were encountered: