Skip to content

Commit a8b885f

Browse files
Expose resolveTypeToTagDecl() publically in HeuristicResolver
1 parent f6c5794 commit a8b885f

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

clang/include/clang/Sema/HeuristicResolver.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ class HeuristicResolver {
8181
// could look up the name appearing on the RHS.
8282
const QualType getPointeeType(QualType T) const;
8383

84+
// Heuristically resolve a possibly-dependent type `T` to a TagDecl
85+
// in which a member's name can be looked up.
86+
TagDecl *resolveTypeToTagDecl(QualType T) const;
87+
8488
private:
8589
ASTContext &Ctx;
8690
};

clang/lib/Sema/HeuristicResolver.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class HeuristicResolverImpl {
4848
std::vector<const NamedDecl *>
4949
lookupDependentName(CXXRecordDecl *RD, DeclarationName Name,
5050
llvm::function_ref<bool(const NamedDecl *ND)> Filter);
51+
TagDecl *resolveTypeToTagDecl(QualType T);
5152

5253
private:
5354
ASTContext &Ctx;
@@ -73,11 +74,6 @@ class HeuristicResolverImpl {
7374
QualType resolveExprToType(const Expr *E);
7475
std::vector<const NamedDecl *> resolveExprToDecls(const Expr *E);
7576

76-
// Helper function for HeuristicResolver::resolveDependentMember()
77-
// which takes a possibly-dependent type `T` and heuristically
78-
// resolves it to a TagDecl in which we can try name lookup.
79-
TagDecl *resolveTypeToTagDecl(QualType T);
80-
8177
// Helper function for simplifying a type.
8278
// `Type` is the type to simplify.
8379
// `E` is the expression whose type `Type` is, if known. This sometimes
@@ -553,5 +549,8 @@ std::vector<const NamedDecl *> HeuristicResolver::lookupDependentName(
553549
const QualType HeuristicResolver::getPointeeType(QualType T) const {
554550
return HeuristicResolverImpl(Ctx).getPointeeType(T);
555551
}
552+
TagDecl *HeuristicResolver::resolveTypeToTagDecl(QualType T) const {
553+
return HeuristicResolverImpl(Ctx).resolveTypeToTagDecl(T);
554+
}
556555

557556
} // namespace clang

0 commit comments

Comments
 (0)