Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upclang++/g++ disagree on how template arguments in substitutions are resolved #68
Comments
This comment has been minimized.
This comment has been minimized.
|
I suspect the same problem could occur with function parameter references, though an example would have to be very complicated. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rocallahan commentedNov 2, 2018
•
edited
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-cxxfiltassumes the former, butc++filtassumes 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.