Mac下llvm10+ccls诊断错误

compile_commands.json

[
{
  "directory": "/Users/apple/MegaAsync/MEGA/MyProject/PythonVM/build",
  "command": "/usr/local/opt/llvm/bin/clang++  -DQT_CORE_LIB -I/Users/apple/MegaAsync/MEGA/MyProject/PythonVM/build -iframework /usr/local/Cellar/qt/5.14.2/lib -isystem /usr/local/Cellar/qt/5.14.2/lib/QtCore.framework/Headers -isystem /usr/local/Cellar/qt/5.14.2/./mkspecs/macx-clang   -O0 -Wall -g -ggdb -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk   -fPIC -std=gnu++17 -o CMakeFiles/stone.dir/stone.cpp.o -c /Users/apple/MegaAsync/MEGA/MyProject/PythonVM/src/stone.cpp",
  "file": "/Users/apple/MegaAsync/MEGA/MyProject/PythonVM/src/stone.cpp"
}
]

ccls --index=. -v=2

18:08:03                initialize.cc:274 I initialize in directory /Users/apple/MegaAsync/MEGA/MyProject/PythonVM with uri file:///Users/apple/MegaAsync/MEGA/MyProject/PythonVM/.
18:08:03                initialize.cc:297 I initializationOptions: {"compilationDatabaseCommand":"","compilationDatabaseDirectory":"","cache":{"directory":".ccls-cache","format":"binary","hierarchicalPath":false,"retainInMemory":2},"capabilities":{"documentOnTypeFormattingProvider":{"firstTriggerCharacter":"}","moreTriggerCharacter":[]},"foldingRangeProvider":true,"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":true}}},"clang":{"excludeArgs":[],"extraArgs":[],"pathMappings":[],"resourceDir":""},"client":{"diagnosticsRelatedInformation":true,"hierarchicalDocumentSymbolSupport":true,"linkSupport":true,"snippetSupport":true},"codeLens":{"localVariables":true},"completion":{"caseSensitivity":2,"detailedLabel":true,"dropOldRequests":true,"duplicateOptional":true,"filterAndSort":true,"include":{"blacklist":[],"maxPathSize":30,"suffixWhitelist":[".h",".hpp",".hh",".inc"],"whitelist":[]},"maxNum":100,"placeholder":true},"diagnostics":{"blacklist":[],"onChange":1000,"onOpen":0,"onSave":0,"spellChecking":true,"whitelist":[]},"highlight":{"largeFileSize":2097152,"lsRanges":false,"blacklist":[],"whitelist":[]},"index":{"blacklist":[],"comments":2,"initialNoLinkage":false,"initialBlacklist":[],"initialWhitelist":[],"maxInitializerLines":5,"multiVersion":0,"multiVersionBlacklist":[],"multiVersionWhitelist":[],"name":{"suppressUnwrittenScope":false},"onChange":false,"parametersInDeclarations":true,"threads":0,"trackDependency":2,"whitelist":[]},"request":{"timeout":5000},"session":{"maxNum":10},"workspaceSymbol":{"caseSensitivity":1,"maxNum":1000,"sort":true},"xref":{"maxNum":2000}}
18:08:03                initialize.cc:329 I use -resource-dir=/usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/
18:08:03                initialize.cc:362 I workspace folder: /Users/apple/MegaAsync/MEGA/MyProject/PythonVM/
18:08:03                   project.cc:426 I loaded /Users/apple/MegaAsync/MEGA/MyProject/PythonVM/compile_commands.json
18:08:03                initialize.cc:387 I start 8 indexers
18:08:03                initialize.cc:395 I dispatch initial index requests
entries:     1
pending:     118:08:03                  pipeline.cc:290 I load cache for /Users/apple/MegaAsync/MEGA/MyProject/PythonVM/src/stone.cpp
pending:     0

还是没弄好,难办

感覺是Apple魔改的LLVM的bug… 上游9.0.0和HEAD都是好的

剛剛有人報告了這個 https://github.com/MaskRay/ccls/issues/664 我找到了這個貼文……