[clang] [clang][Index] Use HeuristicResolver in libIndex (PR #125153)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Mon May 5 17:46:16 PDT 2025


================
@@ -25,6 +26,17 @@ static bool isGeneratedDecl(const Decl *D) {
   return false;
 }
 
+IndexingContext::IndexingContext(IndexingOptions IndexOpts,
+                                 IndexDataConsumer &DataConsumer)
+    : IndexOpts(IndexOpts), DataConsumer(DataConsumer) {}
+
+IndexingContext::~IndexingContext() = default;
----------------
shafik wrote:

@HighCommander4 you defaulted the destructor in the source file b/c of the `std::unique_ptr<HeuristicResolver> Resolver` which would require the `HeuristicResolver` to be complete when the destructor is defined, correct? 

This was flagged by static analysis as a rule of three violation but it looks like it makes sense in this case but it should have been explicitly documented with a comment b/c it is not obvious w/o some digging.

https://github.com/llvm/llvm-project/pull/125153


More information about the cfe-commits mailing list