Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-24537

Build error "member access into incomplete type 'const clang::FileEntry"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Duplicate
    • Affects Version/s: Qt Creator 4.14.0-beta1
    • Fix Version/s: None
    • Component/s: Building Qt Creator
    • Labels:
      None
    • Environment:
      Xcode 10
    • Platform/s:
      macOS

      Description

      The error:

      In file included from src/tools/clangrefactoringbackend/source/collectsymbolsaction.cpp:26:
      In file included from src/tools/clangrefactoringbackend/source/collectsymbolsaction.h:29:
      In file included from src/tools/clangrefactoringbackend/source/indexdataconsumer.h:32:
      In file included from src/tools/clangrefactoringbackend/source/symbolsvisitorbase.h:28:
      src/tools/clangrefactoringbackend/source/sourcelocationsutils.h:90:76: error: member access into incomplete type 'const clang::FileEntry'
              auto filePath = FilePath::fromNativeFilePath(absolutePath(fileEntry->getName()));
                                                                                 ^
      In file included from src/tools/clangrefactoringbackend/source/collectsymbolsaction.cpp:26:
      In file included from src/tools/clangrefactoringbackend/source/collectsymbolsaction.h:29:
      In file included from src/tools/clangrefactoringbackend/source/indexdataconsumer.h:32:
      In file included from src/tools/clangrefactoringbackend/source/symbolsvisitorbase.h:28:
      In file included from src/tools/clangrefactoringbackend/source/sourcelocationsutils.h:32:
      In file included from include/clang/Basic/SourceManager.h:37:
      In file included from include/clang/Basic/Diagnostic.h:19:
      include/clang/Basic/SourceLocation.h:356:7: note: forward declaration of 'clang::FileEntry'
      class FileEntry;
            ^
      In file included from src/tools/clangrefactoringbackend/source/collectsymbolsaction.cpp:26:
      In file included from src/tools/clangrefactoringbackend/source/collectsymbolsaction.h:29:
      In file included from src/tools/clangrefactoringbackend/source/indexdataconsumer.h:32:
      src/tools/clangrefactoringbackend/source/symbolsvisitorbase.h:66:36: error: member access into incomplete type 'const clang::FileEntry'
                  uint fileId = fileEntry->getUID();
                                         ^
      In file included from src/tools/clangrefactoringbackend/source/collectsymbolsaction.cpp:26:
      In file included from src/tools/clangrefactoringbackend/source/collectsymbolsaction.h:29:
      In file included from src/tools/clangrefactoringbackend/source/indexdataconsumer.h:32:
      In file included from src/tools/clangrefactoringbackend/source/symbolsvisitorbase.h:28:
      In file included from src/tools/clangrefactoringbackend/source/sourcelocationsutils.h:32:
      In file included from include/clang/Basic/SourceManager.h:37:
      In file included from include/clang/Basic/Diagnostic.h:19:
      include/clang/Basic/SourceLocation.h:356:7: note: forward declaration of 'clang::FileEntry'
      class FileEntry;
            ^
      In file included from src/tools/clangrefactoringbackend/source/collectsymbolsaction.cpp:26:
      In file included from src/tools/clangrefactoringbackend/source/collectsymbolsaction.h:29:
      In file included from src/tools/clangrefactoringbackend/source/indexdataconsumer.h:32:
      src/tools/clangrefactoringbackend/source/symbolsvisitorbase.h:76:38: error: member access into incomplete type 'const clang::FileEntry'
                  auto filePath = fileEntry->getName();
                                           ^
      In file included from src/tools/clangrefactoringbackend/source/collectsymbolsaction.cpp:26:
      In file included from src/tools/clangrefactoringbackend/source/collectsymbolsaction.h:29:
      In file included from src/tools/clangrefactoringbackend/source/indexdataconsumer.h:32:
      In file included from src/tools/clangrefactoringbackend/source/symbolsvisitorbase.h:28:
      In file included from src/tools/clangrefactoringbackend/source/sourcelocationsutils.h:32:
      In file included from include/clang/Basic/SourceManager.h:37:
      In file included from include/clang/Basic/Diagnostic.h:19:
      include/clang/Basic/SourceLocation.h:356:7: note: forward declaration of 'clang::FileEntry'
      class FileEntry;
            ^
      3 errors generated.
      

      The fix :

      diff --git a/src/tools/clangrefactoringbackend/source/sourcelocationsutils.h b/src/tools/clangrefactoringbackend/source/sourcelocationsutils.h
      index 45bc71f..6304523 100644
      --- a/src/tools/clangrefactoringbackend/source/sourcelocationsutils.h
      +++ b/src/tools/clangrefactoringbackend/source/sourcelocationsutils.h
      @@ -30,6 +30,7 @@
       #include <sourcerangescontainer.h>
       
       #include <clang/Basic/SourceManager.h>
      +#include <clang/Basic/FileManager.h>
       #include <clang/Lex/Lexer.h>
       #include <llvm/Support/FileSystem.h>
       #include <llvm/Support/FileUtilities.h>
      
      

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              con Eike Ziller
              Reporter:
              rz R Z
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes