summaryrefslogtreecommitdiffstats
path: root/lib/Sema/Lookup.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/Lookup.h')
-rw-r--r--lib/Sema/Lookup.h31
1 files changed, 27 insertions, 4 deletions
diff --git a/lib/Sema/Lookup.h b/lib/Sema/Lookup.h
index c5eecda..9064de6 100644
--- a/lib/Sema/Lookup.h
+++ b/lib/Sema/Lookup.h
@@ -32,6 +32,11 @@ public:
/// @brief No entity found met the criteria.
NotFound = 0,
+ /// @brief No entity found met the criteria within the current
+ /// instantiation,, but there were dependent base classes of the
+ /// current instantiation that could not be searched.
+ NotFoundInCurrentInstantiation,
+
/// @brief Name lookup found a single declaration that met the
/// criteria. getFoundDecl() will return this declaration.
Found,
@@ -268,6 +273,19 @@ public:
Decls.set_size(N);
}
+ /// \brief Determine whether no result was found because we could not
+ /// search into dependent base classes of the current instantiation.
+ bool wasNotFoundInCurrentInstantiation() const {
+ return ResultKind == NotFoundInCurrentInstantiation;
+ }
+
+ /// \brief Note that while no result was found in the current instantiation,
+ /// there were dependent base classes that could not be searched.
+ void setNotFoundInCurrentInstantiation() {
+ assert(ResultKind == NotFound && Decls.empty());
+ ResultKind = NotFoundInCurrentInstantiation;
+ }
+
/// \brief Resolves the result kind of the lookup, possibly hiding
/// decls.
///
@@ -278,9 +296,10 @@ public:
/// \brief Re-resolves the result kind of the lookup after a set of
/// removals has been performed.
void resolveKindAfterFilter() {
- if (Decls.empty())
- ResultKind = NotFound;
- else {
+ if (Decls.empty()) {
+ if (ResultKind != NotFoundInCurrentInstantiation)
+ ResultKind = NotFound;
+ } else {
ResultKind = Found;
resolveKind();
}
@@ -524,7 +543,11 @@ private:
///
/// \param Hiding a declaration that hides the declaration \p ND,
/// or NULL if no such declaration exists.
- virtual void FoundDecl(NamedDecl *ND, NamedDecl *Hiding) = 0;
+ ///
+ /// \param InBaseClass whether this declaration was found in base
+ /// class of the context we searched.
+ virtual void FoundDecl(NamedDecl *ND, NamedDecl *Hiding,
+ bool InBaseClass) = 0;
};
}
OpenPOWER on IntegriCloud