Skip to content

Commit d5be29e

Browse files
Expose resolveTypeToTagDecl() publically in HeuristicResolver
1 parent 909de4a commit d5be29e

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
@@ -47,6 +47,7 @@ class HeuristicResolverImpl {
4747
std::vector<const NamedDecl *>
4848
lookupDependentName(CXXRecordDecl *RD, DeclarationName Name,
4949
llvm::function_ref<bool(const NamedDecl *ND)> Filter);
50+
TagDecl *resolveTypeToTagDecl(QualType T);
5051

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

75-
// Helper function for HeuristicResolver::resolveDependentMember()
76-
// which takes a possibly-dependent type `T` and heuristically
77-
// resolves it to a TagDecl in which we can try name lookup.
78-
TagDecl *resolveTypeToTagDecl(QualType T);
79-
8076
// Helper function for simplifying a type.
8177
// `Type` is the type to simplify.
8278
// `E` is the expression whose type `Type` is, if known. This sometimes
@@ -538,5 +534,8 @@ std::vector<const NamedDecl *> HeuristicResolver::lookupDependentName(
538534
const QualType HeuristicResolver::getPointeeType(QualType T) const {
539535
return HeuristicResolverImpl(Ctx).getPointeeType(T);
540536
}
537+
TagDecl *HeuristicResolver::resolveTypeToTagDecl(QualType T) const {
538+
return HeuristicResolverImpl(Ctx).resolveTypeToTagDecl(T);
539+
}
541540

542541
} // namespace clang

0 commit comments

Comments
 (0)