Propagate ParameterModifiers in templates#4089
Merged
llvm-beanz merged 1 commit intomicrosoft:masterfrom Nov 18, 2021
Merged
Conversation
This addresses two issues that blocked template instantiation of functions with ParameterModifiers. The first issue is that template deduction was not propagating ParameterModifiers, but since the modifiers do influence overload resolution, matches were never being found. The second issue is that template instantiation was not propagating ParameterModifiers, so even if dedution managed to succeed, it would produce an instantiaton that wouldn't match. The silly issue that still remains after this is that our ParameterModifiers sholud be attached to the QualType for the parameters. We already bake in the effect of the ParameterModifier to the QualType, so we were getting overload mismatches on identical functions. If we move the ParameterModifiers to the QualTypes similar to other type qualifiers, we can actually get rid of this patch. This resolves microsoft#4084
tex3d
approved these changes
Nov 18, 2021
Contributor
tex3d
left a comment
There was a problem hiding this comment.
I think this looks good, and your advice about moving the parameter modifiers sounds right. I guess we can do that in a future change, since it seems like a larger amount of work.
Collaborator
Author
|
That was my thought. This is minimally invasive and should be good for the HLSL 2021 release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This addresses two issues that blocked template instantiation of
functions with ParameterModifiers.
The first issue is that template deduction was not propagating
ParameterModifiers, but since the modifiers do influence overload
resolution, matches were never being found.
The second issue is that template instantiation was not propagating
ParameterModifiers, so even if dedution managed to succeed, it would
produce an instantiaton that wouldn't match.
The silly issue that still remains after this is that our
ParameterModifiers sholud be attached to the QualType for the
parameters. We already bake in the effect of the ParameterModifier to
the QualType, so we were getting overload mismatches on identical
functions. If we move the ParameterModifiers to the QualTypes similar
to other type qualifiers, we can actually get rid of this patch.
This resolves #4084