[PATCH] D128974: [AST] [Modules] Handle full cases of DefaultArgStorage::setInherited
Chuanqi Xu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 1 02:27:10 PDT 2022
ChuanqiXu created this revision.
ChuanqiXu added reviewers: erichkeane, iains, vsapsai, v.g.vassilev, dblaikie, rsmith, jansvoboda11, aaron.ballman.
ChuanqiXu added projects: clang, clang-modules.
Herald added a project: All.
ChuanqiXu requested review of this revision.
Herald added a subscriber: cfe-commits.
There were two assertions in DefaultArgStorage::setInherited previously. But there are edge cases could hit them actually. One is `InheritDefaultArguments.cppm` that I found recently (there is another issue in the driver: https://github.com/llvm/llvm-project/issues/56327). Another one is pr31469.cpp, which was created fives years ago.
This patch tries to fix the two failures by handling more cases in DefaultArgStorage::setInherited. And I added assertions for sameness to keep correctness.
This is guaranteed to not introduce any breaking change since it lives in the path we wouldn't touch before.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D128974
Files:
clang/include/clang/AST/ASTContext.h
clang/include/clang/AST/DeclTemplate.h
clang/lib/AST/ASTContext.cpp
clang/lib/Sema/SemaTemplate.cpp
clang/test/Modules/InheritDefaultArguments.cppm
clang/test/Modules/Inputs/PR31469/textual.h
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128974.441642.patch
Type: text/x-patch
Size: 9503 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220701/1ff1a0bf/attachment.bin>
More information about the cfe-commits
mailing list