[PATCH] D78359: [clangd] Do not store BaseOf relations for missing subjects

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 17 04:50:06 PDT 2020


kadircet created this revision.
Herald added subscribers: cfe-commits, usaxena95, arphaman, jkorous, MaskRay, ilya-biryukov.
Herald added a project: clang.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D78359

Files:
  clang-tools-extra/clangd/index/SymbolCollector.cpp


Index: clang-tools-extra/clangd/index/SymbolCollector.cpp
===================================================================
--- clang-tools-extra/clangd/index/SymbolCollector.cpp
+++ clang-tools-extra/clangd/index/SymbolCollector.cpp
@@ -469,7 +469,10 @@
     if (!ObjectID)
       continue;
 
-    // Record the relation.
+    // In a BaseOf relation we must've seen the definition/declaration of base
+    // type.
+    if (!Symbols.find(ID))
+      continue;
     // TODO: There may be cases where the object decl is not indexed for some
     // reason. Those cases should probably be removed in due course, but for
     // now there are two possible ways to handle it:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78359.258287.patch
Type: text/x-patch
Size: 675 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200417/771832c4/attachment.bin>


More information about the cfe-commits mailing list