From b95b47540d09a522bafefa4f95eb9bea8c04e9be Mon Sep 17 00:00:00 2001 From: Chao Shen Date: Fri, 27 Jul 2018 11:08:22 +0800 Subject: [PATCH] Fix diagnostics on MacOS and duplicated bases. --- index_tests/namespaces/namespace_alias.cc | 4 ++-- src/clang_tu.cc | 3 ++- src/indexer.cc | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/index_tests/namespaces/namespace_alias.cc b/index_tests/namespaces/namespace_alias.cc index 118e20c7..b659f553 100644 --- a/index_tests/namespaces/namespace_alias.cc +++ b/index_tests/namespaces/namespace_alias.cc @@ -87,7 +87,7 @@ OUTPUT: "kind": 3, "declarations": ["3:20-3:23|17805385787823406700|2|1025"], "alias_of": 0, - "bases": [17805385787823406700, 17805385787823406700, 17805385787823406700, 17805385787823406700], + "bases": [17805385787823406700], "derived": [], "types": [], "funcs": [], @@ -105,7 +105,7 @@ OUTPUT: "kind": 3, "declarations": ["2:15-2:18|926793467007732869|2|1025"], "alias_of": 0, - "bases": [926793467007732869, 926793467007732869, 926793467007732869, 926793467007732869], + "bases": [926793467007732869], "derived": [14450849931009540802], "types": [14450849931009540802], "funcs": [], diff --git a/src/clang_tu.cc b/src/clang_tu.cc index 64c4a4ec..bc40e404 100644 --- a/src/clang_tu.cc +++ b/src/clang_tu.cc @@ -85,7 +85,8 @@ std::unique_ptr ClangTranslationUnit::Create( Unit.reset(ASTUnit::LoadFromCommandLine( Args.data(), Args.data() + Args.size(), /*PCHContainerOpts=*/ret->PCHCO, Diags, - /*ResourceFilePath=*/"", /*OnlyLocalDecls=*/false, + /*ResourceFilePath=*/g_config->clang.resourceDir, + /*OnlyLocalDecls=*/false, /*CaptureDiagnostics=*/diagnostic, Remapped, /*RemappedFilesKeepOriginalName=*/true, 1, diagnostic ? TU_Complete : TU_Prefix, diff --git a/src/indexer.cc b/src/indexer.cc index 1325cf6f..80999862 100644 --- a/src/indexer.cc +++ b/src/indexer.cc @@ -1221,6 +1221,7 @@ std::vector> Index( Uniquify(it.second.derived); Uniquify(it.second.uses); // e.g. declaration + out-of-line definition + Uniquify(it.second.def.bases); Uniquify(it.second.def.funcs); } for (auto& it : entry->usr2var)