[PATCH] D60503: [clangd] Don't insert extra namespace qualifiers when Sema gets lost.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 10 04:59:17 PDT 2019


sammccall marked an inline comment as done.
sammccall added inline comments.


================
Comment at: clangd/CodeComplete.cpp:545
                const CodeCompleteOptions &Opts) {
-  auto GetAllAccessibleScopes = [](CodeCompletionContext &CCContext) {
-    SpecifiedScope Info;
-    for (auto *Context : CCContext.getVisitedContexts()) {
-      if (isa<TranslationUnitDecl>(Context))
-        Info.AccessibleScopes.push_back(""); // global namespace
-      else if (isa<NamespaceDecl>(Context))
-        Info.AccessibleScopes.push_back(printNamespaceScope(*Context));
-    }
-    return Info;
-  };
-
-  auto SS = CCContext.getCXXScopeSpecifier();
+  SpecifiedScope Scopes;
+  for (auto *Context : CCContext.getVisitedContexts()) {
----------------
(AFAICT this lambda was executed the same way on every code path, so I just inlined it)


Repository:
  rCTE Clang Tools Extra

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60503/new/

https://reviews.llvm.org/D60503





More information about the cfe-commits mailing list