summaryrefslogtreecommitdiffstats
path: root/clang/include/clang/AST/CXXInheritance.h
diff options
context:
space:
mode:
Diffstat (limited to 'clang/include/clang/AST/CXXInheritance.h')
-rw-r--r--clang/include/clang/AST/CXXInheritance.h15
1 files changed, 6 insertions, 9 deletions
diff --git a/clang/include/clang/AST/CXXInheritance.h b/clang/include/clang/AST/CXXInheritance.h
index 008efb36477..8587260049a 100644
--- a/clang/include/clang/AST/CXXInheritance.h
+++ b/clang/include/clang/AST/CXXInheritance.h
@@ -155,7 +155,7 @@ class CXXBasePaths {
/// \brief Array of the declarations that have been found. This
/// array is constructed only if needed, e.g., to iterate over the
/// results within LookupResult.
- NamedDecl **DeclsFound;
+ std::unique_ptr<NamedDecl *[]> DeclsFound;
unsigned NumDeclsFound;
friend class CXXRecordDecl;
@@ -172,15 +172,12 @@ public:
/// BasePaths - Construct a new BasePaths structure to record the
/// paths for a derived-to-base search.
- explicit CXXBasePaths(bool FindAmbiguities = true,
- bool RecordPaths = true,
+ explicit CXXBasePaths(bool FindAmbiguities = true, bool RecordPaths = true,
bool DetectVirtual = true)
- : FindAmbiguities(FindAmbiguities), RecordPaths(RecordPaths),
- DetectVirtual(DetectVirtual), DetectedVirtual(nullptr),
- DeclsFound(nullptr), NumDeclsFound(0) { }
-
- ~CXXBasePaths() { delete [] DeclsFound; }
-
+ : FindAmbiguities(FindAmbiguities), RecordPaths(RecordPaths),
+ DetectVirtual(DetectVirtual), DetectedVirtual(nullptr),
+ NumDeclsFound(0) {}
+
paths_iterator begin() { return Paths.begin(); }
paths_iterator end() { return Paths.end(); }
const_paths_iterator begin() const { return Paths.begin(); }
OpenPOWER on IntegriCloud