Skip to content

Commit 34204a0

Browse files
committed
fix: track whether base-specifiers were a pack expansion
1 parent 1e6e9ae commit 34204a0

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

src/lib/AST/ASTVisitor.cpp

+11-6
Original file line numberDiff line numberDiff line change
@@ -1758,13 +1758,18 @@ class ASTVisitor
17581758
access == AccessSpecifier::AS_protected)
17591759
continue;
17601760
}
1761-
1761+
// the extraction of the base type is
1762+
// performed in direct dependency mode
1763+
auto BaseType = buildTypeInfo(
1764+
B.getType(),
1765+
ExtractMode::DirectDependency);
1766+
// CXXBaseSpecifier::getEllipsisLoc indicates whether the
1767+
// base was a pack expansion; a PackExpansionType is not built
1768+
// for base-specifiers
1769+
if(BaseType && B.getEllipsisLoc().isValid())
1770+
BaseType->IsPackExpansion = true;
17621771
I.Bases.emplace_back(
1763-
// the extraction of the base type is
1764-
// performed in direct dependency mode
1765-
buildTypeInfo(
1766-
B.getType(),
1767-
ExtractMode::DirectDependency),
1772+
std::move(BaseType),
17681773
convertToAccessKind(access),
17691774
B.isVirtual());
17701775
}

test-files/old-tests/record-inheritance.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ class C6 : virtual C1 {};
1919
class C7 : public C5, public C6 {};
2020

2121
struct S5 : private S0, protected S1 {};
22+
23+
template<typename... Ts>
24+
struct S6 : Ts... { };

test-files/old-tests/record-inheritance.xml

+9
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,14 @@
9090
<type id="Tu+ql/Sdpk31DKHwwD/67uI3OZE=" name="S1"/>
9191
</base>
9292
</struct>
93+
<template>
94+
<tparam name="Ts" class="type"/>
95+
<struct name="S6" id="dt7vZMcsOL5ylokCpCZgvCsG/po=">
96+
<file path="record-inheritance.cpp" line="24" class="def"/>
97+
<base>
98+
<type is-pack="1" name="Ts"/>
99+
</base>
100+
</struct>
101+
</template>
93102
</namespace>
94103
</mrdocs>

0 commit comments

Comments
 (0)