diff options
author | cor3ntin <corentinjabot@gmail.com> | 2024-01-27 10:23:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-27 10:23:38 +0100 |
commit | ad1a65fcacda8794e2f1fa3e1dec1c1b7813422c (patch) | |
tree | ee68f0f3f24c7dfaa09a2b75dc5427d7f11b6a15 /clang/lib/AST/ASTStructuralEquivalence.cpp | |
parent | 1f13203029333ac99cc9844b8b6915aae3fc0902 (diff) | |
download | llvm-ad1a65fcacda8794e2f1fa3e1dec1c1b7813422c.zip llvm-ad1a65fcacda8794e2f1fa3e1dec1c1b7813422c.tar.gz llvm-ad1a65fcacda8794e2f1fa3e1dec1c1b7813422c.tar.bz2 |
[Clang][C++26] Implement Pack Indexing (P2662R3). (#72644)
Implements https://isocpp.org/files/papers/P2662R3.pdf
The feature is exposed as an extension in older language modes.
Mangling is not yet supported and that is something we will have to do before release.
Diffstat (limited to 'clang/lib/AST/ASTStructuralEquivalence.cpp')
-rw-r--r-- | clang/lib/AST/ASTStructuralEquivalence.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTStructuralEquivalence.cpp b/clang/lib/AST/ASTStructuralEquivalence.cpp index be7a850a..a7ddf6d 100644 --- a/clang/lib/AST/ASTStructuralEquivalence.cpp +++ b/clang/lib/AST/ASTStructuralEquivalence.cpp @@ -1292,6 +1292,16 @@ static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, return false; break; + case Type::PackIndexing: + if (!IsStructurallyEquivalent(Context, + cast<PackIndexingType>(T1)->getPattern(), + cast<PackIndexingType>(T2)->getPattern())) + if (!IsStructurallyEquivalent(Context, + cast<PackIndexingType>(T1)->getIndexExpr(), + cast<PackIndexingType>(T2)->getIndexExpr())) + return false; + break; + case Type::ObjCInterface: { const auto *Iface1 = cast<ObjCInterfaceType>(T1); const auto *Iface2 = cast<ObjCInterfaceType>(T2); |