diff options
Diffstat (limited to 'include/clang/Sema/Lookup.h')
-rw-r--r-- | include/clang/Sema/Lookup.h | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/include/clang/Sema/Lookup.h b/include/clang/Sema/Lookup.h index 1c7720abb1e1..aa58d14fac73 100644 --- a/include/clang/Sema/Lookup.h +++ b/include/clang/Sema/Lookup.h @@ -365,6 +365,11 @@ public: if (Decls.empty()) { if (ResultKind != NotFoundInCurrentInstantiation) ResultKind = NotFound; + + if (Paths) { + deletePaths(Paths); + Paths = 0; + } } else { AmbiguityKind SavedAK = Ambiguity; ResultKind = Found; @@ -492,25 +497,18 @@ public: LookupResult &Results; LookupResult::iterator I; bool Changed; -#ifndef NDEBUG bool CalledDone; -#endif friend class LookupResult; Filter(LookupResult &Results) - : Results(Results), I(Results.begin()), Changed(false) -#ifndef NDEBUG - , CalledDone(false) -#endif + : Results(Results), I(Results.begin()), Changed(false), CalledDone(false) {} public: -#ifndef NDEBUG ~Filter() { assert(CalledDone && "LookupResult::Filter destroyed without done() call"); } -#endif bool hasNext() const { return I != Results.end(); @@ -541,10 +539,8 @@ public: } void done() { -#ifndef NDEBUG assert(!CalledDone && "done() called twice"); CalledDone = true; -#endif if (Changed) Results.resolveKindAfterFilter(); @@ -573,11 +569,7 @@ private: void configure(); // Sanity checks. -#ifndef NDEBUG void sanity() const; -#else - void sanity() const {} -#endif bool sanityCheckUnresolved() const { for (iterator I = begin(), E = end(); I != E; ++I) |