MaskRay / ccls

C/C++/ObjC language server supporting cross references, hierarchies, completion and semantic highlighting
Apache License 2.0
3.73k stars 254 forks source link

Can't build with Clang 14 #879

Closed sergei-dyshel closed 2 years ago

sergei-dyshel commented 2 years ago
/local/home/sergei/repos/ccls/src/working_files.cc:345:19: error: use of undeclared identifier 'isIdentifierBody'
  while (i > 0 && isIdentifierBody(buffer_content[i - 1]))
                  ^
/local/home/sergei/repos/ccls/src/working_files.cc:458:15: error: use of undeclared identifier 'isIdentifierBody'
    else if (!isIdentifierBody(c))
              ^
/local/home/sergei/repos/ccls/src/working_files.cc:461:34: error: use of undeclared identifier 'isIdentifierBody'
  for (; end < content.size() && isIdentifierBody(content[end]); end++)
                                 ^
3 errors generated.
make[2]: *** [CMakeFiles/ccls.dir/src/working_files.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/local/home/sergei/repos/ccls/src/query.cc:205:23: error: no member named 'find_if' in namespace 'llvm'
      auto it = llvm::find_if(func.def, [=](const QueryFunc::Def &def) {
                ~~~~~~^
/local/home/sergei/repos/ccls/src/query.cc:219:23: error: no member named 'find_if' in namespace 'llvm'
      auto it = llvm::find_if(type.def, [=](const QueryType::Def &def) {
                ~~~~~~^
/local/home/sergei/repos/ccls/src/query.cc:233:23: error: no member named 'find_if' in namespace 'llvm'
      auto it = llvm::find_if(var.def, [=](const QueryVar::Def &def) {
                ~~~~~~^
3 errors generated.
make[2]: *** [CMakeFiles/ccls.dir/src/query.cc.o] Error 1
/local/home/sergei/repos/ccls/src/indexer.cc:530:21: error: use of undeclared identifier 'isIdentifierBody'; did you mean 'IdentifierLoc'?
             ((i && isIdentifierBody(name[i - 1])) ||
                    ^
/home/sergei/opt/clang-14.0.1/include/clang/Sema/ParsedAttr.h:187:8: note: 'IdentifierLoc' declared here
struct IdentifierLoc {
       ^
/local/home/sergei/repos/ccls/src/indexer.cc:531:15: error: use of undeclared identifier 'isIdentifierBody'; did you mean 'IdentifierLoc'?
              isIdentifierBody(name[i + short_name.size()])))
              ^
/home/sergei/opt/clang-14.0.1/include/clang/Sema/ParsedAttr.h:187:8: note: 'IdentifierLoc' declared here
struct IdentifierLoc {
       ^
/local/home/sergei/repos/ccls/src/indexer.cc:555:31: error: use of undeclared identifier 'isIdentifierBody'; did you mean 'IdentifierLoc'?
      else if (!(paren > 0 || isIdentifierBody(name[i - 1]) ||
                              ^
/home/sergei/opt/clang-14.0.1/include/clang/Sema/ParsedAttr.h:187:8: note: 'IdentifierLoc' declared here
struct IdentifierLoc {
       ^
/local/home/sergei/repos/ccls/src/messages/textDocument_signatureHelp.cc:84:36: error: non-virtual member function marked 'override' hides virtual member function
                                 ) override {
                                   ^
/home/sergei/opt/clang-14.0.1/include/clang/Sema/CodeCompleteConsumer.h:1192:16: note: hidden overloaded virtual function 'clang::CodeCompleteConsumer::ProcessOverloadCandidates' declared here: different number of parameters (6 vs 5)
  virtual void ProcessOverloadCandidates(Sema &S, unsigned CurrentArg,
               ^
/local/home/sergei/repos/ccls/src/messages/textDocument_signatureHelp.cc:96:75: error: too few arguments to function call, expected 6, have 5
          cand.CreateSignatureString(currentArg, s, *alloc, cCTUInfo, true);
          ~~~~~~~~~~~~~~~~~~~~~~~~~~                                      ^
/home/sergei/opt/clang-14.0.1/include/clang/Sema/CodeCompleteConsumer.h:1118:5: note: 'CreateSignatureString' declared here
    CreateSignatureString(unsigned CurrentArg, Sema &S,
    ^
3
sergei-dyshel commented 2 years ago

build with clang 13 works fine

dtzWill commented 2 years ago

Are you building the tagged release? I'd guess so, from your errors. If so, try building using latest master, it contains fixes for the listed errors:

There are some other fixes as well, especially for post-14 development, take a look: https://github.com/MaskRay/ccls/compare/0.20210330...master

You may be interested in watching #878 for possibly a new tagged release with support for LLVM(/Clang) 14.

sergei-dyshel commented 2 years ago

@dtzWill You're right, I was using very old version of ccls by mistake. Thank you!