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

clang 10 updates needed #15

Closed
bjornstromberg opened this issue Apr 24, 2020 · 2 comments
Closed

clang 10 updates needed #15

bjornstromberg opened this issue Apr 24, 2020 · 2 comments
Assignees

Comments

@bjornstromberg
Copy link

of course the new major clang upgrade mess up stuff again..

from Clang 10.0.0 Release Notes

Internal API Changes
These are major API changes that have happened since the 9.0.0 release of Clang. 
If upgrading an external codebase that uses Clang as a library, 
this section should help get you past the largest hurdles of upgrading.

libTooling APIs that transfer ownership of FrontendAction objects now pass them by unique_ptr,
making the ownership transfer obvious in the type system. 
FrontendActionFactory::create() now returns a unique_ptr<FrontendAction>. 
runToolOnCode, runToolOnCodeWithArgs, 
ToolInvocation::ToolInvocation() now take a unique_ptr<FrontendAction>.

so with clang, llvm and libc++ 10.0.0 on arch linux, moc-ng does not build anymore.

first two errors are isolated to above change note for internal api.

/*buildpath*/moc-ng/src/main.cpp:451:38: error: no matching constructor for initialization of 'clang::tooling::ToolInvocation'
      clang::tooling::ToolInvocation Inv(Argv, new clang::PrintPreprocessedAction, &FM);
/*buildpath*/moc-ng/src/main.cpp:465:34: error: no matching constructor for initialization of 'clang::tooling::ToolInvocation'
  clang::tooling::ToolInvocation Inv(Argv, new MocAction, &FM);

and this one might be a chain reaction.. but adding to the list for completeness.

/*buildpath*/moc-ng/src/mocng.cpp:159:37: error: no viable conversion from 'Optional<clang::FileEntryRef>' to 'const clang::FileEntry *'
            const clang::FileEntry *File = PP.LookupFile(
@bjornstromberg
Copy link
Author

had a look and its only smart pointer related,
i guess the result will be another batch of preprocessor macros,
so it does not mess up builds on older clang.

i'm not going to pursue to get this working on arch linux,
i'll target ubuntu 20.04 with clang-10 instead, it fits the requirements..

i'll have a go at this next week if nobody been bored and fixed it during the weekend.

@bjornstromberg
Copy link
Author

#16 fixes for clang 9 & 10 so both build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants