Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error (clangparser.cpp) #6946

Closed
Lecrapouille opened this issue Apr 25, 2019 · 9 comments
Closed

Compilation error (clangparser.cpp) #6946

Lecrapouille opened this issue Apr 25, 2019 · 9 comments
Labels
bug install/build bug in the installation or build scripts

Comments

@Lecrapouille
Copy link

SHA1 2c72e1c
Debian 9.8 amd64 with installed llvm-6 and clang-6 (from apt-get).

cd doxygen
mkdir build && cd build
cmake -Duse_libclang:BOOL=ON ..
make

Got this error:

doxygen/src/clangparser.cpp: In member function ‘void ClangParser::linkIdentifier(CodeOutputInterface&, FileDef*, uint&, uint&, const char*, int)’:
doxygen/src/clangparser.cpp:785:59: error: cannot convert from pointer to base class ‘Definition’ to pointer to derived class ‘MemberDef’ because the base is virtual
       addDocCrossReference(g_currentMemberDef,(MemberDef*)d);

Note 01: I added -Duse_libclang:BOOL=ON to try to fix the warning:

warning: Tag `CLANG_ASSISTED_PARSING' at line 1073 of file `Doxyfile' belongs to an option that was not enabled at compile time.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u", or recompile doxygen with this feature enabled.
warning: Tag `CLANG_OPTIONS' at line 1081 of file `Doxyfile' belongs to an option that was not enabled at compile time.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u", or recompile doxygen with this feature enabled.

Note 02: without this option, compilation worked fine.

@Lecrapouille
Copy link
Author

Lecrapouille commented Apr 25, 2019

I'm not really sure of what I have done but I added a dynamic_cast and compilation ended. I hope not to have a nullptr soon :)

Edit: I have this error (just typing doxygen)

: CommandLine Error: Option 'help-list' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options

@albert-github
Copy link
Collaborator

albert-github commented Apr 26, 2019

I think this looks like a correct patch when it is something like: dynamic_cast<MemberDef*>(d)
I think the nullptr won't happen as on a previous code line (779) there is a test against the nullptr.

Regarding the LLVM ERROR, I think best is to create a separate issue for it (does not have anything to do with the compilation error) also specifying which compiler you are using and the version of clang you are using.

@Lecrapouille
Copy link
Author

I think this looks like a correct patch when it is something like: dynamic_cast<MemberDef*>(d)
I think the nullptr won't happen as on a previous code line (779) there is a test against the nullptr.

I meant dynamic_cast can return nullptr is there is no relation of inheritance between classes. Because I don't know the code I hope it's ok.

Regarding the LLVM ERROR, I think best is to create a separate issue for it (does not have anything to do with the compilation error) also specifying which compiler you are using and the version of clang you are using.

You are right that may not be related with this compilation error (but appearing with -Duse_libclang:BOOL=ON). I linked cmake with clang-6, I think doxygen was compiled with g++-6

albert-github added a commit to albert-github/doxygen that referenced this issue Apr 27, 2019
corrected clangparser conform other source code in respect to casting.
Corrected doxyapp and doxyparse make scripts for usage with clang parser.
@albert-github
Copy link
Collaborator

I've just pushed a proposed patch, pull request #6947, based on change proposed in the the comment.
Added possibility to build doxyparse and doxyapp also with clang (as they use the doxygen library).

@albert-github albert-github added bug install/build bug in the installation or build scripts labels Apr 27, 2019
doxygen added a commit that referenced this issue Apr 27, 2019
issue #6946 Compilation error (clangparser.cpp)
@albert-github
Copy link
Collaborator

Code has been integrated in master on github (please don't close the issue as this will be done at the moment of a release).

@albert-github albert-github added the fixed but not released Bug is fixed in github, but still needs to make its way to an official release label Apr 28, 2019
@albert-github
Copy link
Collaborator

@Lecrapouille the problem with the LLVM_ERROR might be related with #6379

@Lecrapouille
Copy link
Author

@albert-github ! Thanks I'll try within this week. I'll give you a feedback.

@Lecrapouille
Copy link
Author

@albert-github Finally testing was faster than I was expecting. Removing support in doxygen/src/CMakeLists.txt fix the second bug.

@doxygen
Copy link
Owner

doxygen commented Aug 8, 2019

This issue was previously marked 'fixed but not released',
which means it should be fixed in doxygen version 1.8.16.
Please verify if this is indeed the case. Reopen the
issue if you think it is not fixed and please include any additional information
that you think can be relevant (preferably in the form of a self-contained example).

@doxygen doxygen removed the fixed but not released Bug is fixed in github, but still needs to make its way to an official release label Aug 8, 2019
@doxygen doxygen closed this as completed Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug install/build bug in the installation or build scripts
Projects
None yet
Development

No branches or pull requests

3 participants