aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Serialization/ASTWriterStmt.cpp
diff options
context:
space:
mode:
authorYounan Zhang <zyn7109@gmail.com>2024-11-25 16:16:39 +0800
committerGitHub <noreply@github.com>2024-11-25 16:16:39 +0800
commitdf335b09eac8a48d9afc06d71a86646ff6b08131 (patch)
tree81eedc6972652c4a255f5570c40c1967bf7f3dbd /clang/lib/Serialization/ASTWriterStmt.cpp
parent2585b6e8faf68d1d10ce0f356c4fede5876da6d2 (diff)
downloadllvm-df335b09eac8a48d9afc06d71a86646ff6b08131.zip
llvm-df335b09eac8a48d9afc06d71a86646ff6b08131.tar.gz
llvm-df335b09eac8a48d9afc06d71a86646ff6b08131.tar.bz2
[Clang] Preserve partially substituted pack indexing type/expressions (#116782)
Substituting into pack indexing types/expressions can still result in unexpanded types/expressions, such as `PackIndexingType` or `PackIndexingExpr`. To handle these cases correctly, we should defer the pack size checks to the next round of transformation, when the patterns can be fully expanded. To that end, the `FullySubstituted` flag is now necessary for computing the dependencies of `PackIndexingExprs`. Conveniently, this flag can also represent the prior `ExpandsToEmpty` status with an additional emptiness check. Therefore, I converted all stored flags to use `FullySubstituted`. Fixes https://github.com/llvm/llvm-project/issues/116105
Diffstat (limited to 'clang/lib/Serialization/ASTWriterStmt.cpp')
-rw-r--r--clang/lib/Serialization/ASTWriterStmt.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Serialization/ASTWriterStmt.cpp b/clang/lib/Serialization/ASTWriterStmt.cpp
index e7f567f..4994047 100644
--- a/clang/lib/Serialization/ASTWriterStmt.cpp
+++ b/clang/lib/Serialization/ASTWriterStmt.cpp
@@ -2191,7 +2191,7 @@ void ASTStmtWriter::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
void ASTStmtWriter::VisitPackIndexingExpr(PackIndexingExpr *E) {
VisitExpr(E);
Record.push_back(E->TransformedExpressions);
- Record.push_back(E->ExpandedToEmptyPack);
+ Record.push_back(E->FullySubstituted);
Record.AddSourceLocation(E->getEllipsisLoc());
Record.AddSourceLocation(E->getRSquareLoc());
Record.AddStmt(E->getPackIdExpression());