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 crash when using a default argument from a base template #547

Merged
merged 1 commit into from
May 12, 2024

Conversation

dpaoliello
Copy link
Contributor

@dpaoliello dpaoliello commented Apr 30, 2024

Even if ParamVarDecl::hasDefaultArg returns true, the default argument can be one of three kinds: normal, unparsed and uninstantiated. Each of these kinds needs to be handled differently:

  • Normal: get the default arg via getDefaultArg
  • Unparsed: treat as not having a default arg.
  • Uninstantiated: get the default arg via getUninstantiatedDefaultArg

This change handles all three kinds and centralizes the checks for and calls to get default args to a single location per method.

@dpaoliello dpaoliello changed the title Part 2: Fix crash when using a default argument from a base template (add tests) Fix crash when using a default argument from a base template May 3, 2024
@dpaoliello dpaoliello marked this pull request as ready for review May 6, 2024 21:49
@tannergooding tannergooding merged commit ce3e5c3 into dotnet:main May 12, 2024
13 checks passed
@dpaoliello dpaoliello deleted the uninsttest branch May 13, 2024 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants