-
Notifications
You must be signed in to change notification settings - Fork 163
Cquery reports ast error when precompiled header is used #545
Comments
Does switching Assuming |
@jacobdufault Please check this repo. I tried using |
@jacobdufault Maybe one possible solution would be to add some command line key (for example |
If the right solution here is to ignore -include-pch and -include then we can make project.cc do that for you, a PR to do so would be greatly appreciated :) |
@jacobdufault Sure, I can send a PR, however I'm not sure how is it better to do it - always remove this keys or provide some option that users can set? |
Always remove the keys sgtm, we can add an option if another use files a bug saying they need them. |
Hello, I use cquery build from source from latest master (commit 82c438c). I have a c++ project where I use precompiled headers. It is compiled with clang, OS is linux, x86_64. Cquery is built with libclang from llvm.org (clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-14.04). I use it with vim via vim-lsp plugin. When precompiled headers are disabled, (compile_commands.json has no
-include /path/to/header.h
compiler flag) cquery works just fine, it's fast and quite reliable. However, if I enable pch, cquery reports an ast error from libclang. Here is the full log produced by vim-lsp plugin:And this is my compile_commands.json file:
I tried running the command with compiler suggested by cquery (
$ /usr/bin/clang++ -working-directory=/home/p...
) but it runs without issues, or at least it doesn't report anything. If this helps, I can provide a small test project where this case can be reproduced. For me it would be ok if cquery would just filter out-include
flag, that is basically what I do now to make it work, though I'm not sure if it is the best way to fix it.p.s. Thanks for your work on cquery, it has issues, but in general it's cool and fast and have a lot of useful features!
The text was updated successfully, but these errors were encountered: