[AST] [Modules] Handle full cases of DefaultArgStorage::setInheritedThere were two assertions in DefaultArgStorage::setInherited previously.It requires the DefaultArgument is either empty or an ar
[AST] [Modules] Handle full cases of DefaultArgStorage::setInheritedThere were two assertions in DefaultArgStorage::setInherited previously.It requires the DefaultArgument is either empty or an argument value. Itwould crash if it has a pointer refers to the previous declaration orcontains a chain to the previous declaration.But there are edge cases could hit them actually. One isInheritDefaultArguments.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 inDefaultArgStorage::setInherited.This is guaranteed to not introduce any breaking change since it livesin the path we wouldn't touch before. And the added assertions forsameness should keep the correctness.Reviewed By: v.g.vassilevDifferential Revision: https://reviews.llvm.org/D128974
show more ...
PR31469: Don't add friend template class decls to redecl chain in dependent contexts. Fixes a crash in modules where the template class decl becomes the most recentdecl in the redeclaration cha
PR31469: Don't add friend template class decls to redecl chain in dependent contexts. Fixes a crash in modules where the template class decl becomes the most recentdecl in the redeclaration chain and forcing the template instantiator try toinstantiate the friend declaration, rather than the template definition. In practice, A::list<int> produces a TemplateSpecializationTypeA::__1::list<int, allocator<type-parameter-0-0> >' failing to replace tosubsitute the default argument to allocator<int>. Kudos Richard Smith (D28399).llvm-svn: 291753