This issue was copied from checkedc/checkedc-clang#576
In TreeTransform.h, track the transformed types for parameters. Use
this information to update the types for positional parameter expressions.
This fixes issue #484, which was a typechecking error caused by different types
for uses of parameters in bounds expressions in function types.
The tracking is straightforward: we add a vector of types for parameters.
Positional parameters only occur in bounds expressions in types. When
we transform a function prototype type, we record the transformed types for
parameters before transforming the bounds expressions in the types.
This change also contains a few clean up changes:
- While debugging an alternative approach, I noticed that TreeTransform
had some code that is flagged as specific to template instantiation. It
was mostly code for marking uses. The code in turn called into code that
checked for detecting references to local variables defined in other lexical
contexts (for example, block scopes). Those checks depend on the lexical context
state for Sema. We don't want any of this code running for the kinds
of transforms that we are doing, so I added a new method to TreeTransform.h that
can be overridden to suppress this code.
- Clean up and improve some comments in TreeTransform.h.
- Improve the parameters for TransformExtendedParameterInfo, marking some
as const and changing the order of parameters to group related parameters
together.
Testing:
- Added new regression test for issue 484.
- Passed local testing on Windows.
- Passed automated testing.
This issue was copied from checkedc/checkedc-clang#576
In TreeTransform.h, track the transformed types for parameters. Use
this information to update the types for positional parameter expressions.
This fixes issue #484, which was a typechecking error caused by different types
for uses of parameters in bounds expressions in function types.
The tracking is straightforward: we add a vector of types for parameters.
Positional parameters only occur in bounds expressions in types. When
we transform a function prototype type, we record the transformed types for
parameters before transforming the bounds expressions in the types.
This change also contains a few clean up changes:
had some code that is flagged as specific to template instantiation. It
was mostly code for marking uses. The code in turn called into code that
checked for detecting references to local variables defined in other lexical
contexts (for example, block scopes). Those checks depend on the lexical context
state for Sema. We don't want any of this code running for the kinds
of transforms that we are doing, so I added a new method to TreeTransform.h that
can be overridden to suppress this code.
as const and changing the order of parameters to group related parameters
together.
Testing: