Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AST] [Modules] Handle full cases of DefaultArgStorage::setInherited
There were two assertions in DefaultArgStorage::setInherited previously. It requires the DefaultArgument is either empty or an argument value. It would crash if it has a pointer refers to the previous declaration or contains a chain to the previous declaration. But there are edge cases could hit them actually. One is InheritDefaultArguments.cppm that I found recently. Another one is pr31469.cpp, which was created fives years ago. This patch tries to fix the two failures by handling full cases in DefaultArgStorage::setInherited. This is guaranteed to not introduce any breaking change since it lives in the path we wouldn't touch before. And the added assertions for sameness should keep the correctness. Reviewed By: v.g.vassilev Differential Revision: https://reviews.llvm.org/D128974
- Loading branch information
1 parent
af0a26b
commit 5791bcf
Showing
3 changed files
with
19 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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