Sarcasm / company-irony

company-mode completion back-end for irony-mode
118 stars 11 forks source link

"Failed to parse the file" when using precompiled headers #44

Open vincent-breysse opened 5 years ago

vincent-breysse commented 5 years ago

Hi there, I can't get company working correctly with precompiled headers, nor with cotire, nor manually, otherwise it works perfectly fine.

So my project is organized in a typical way, I have the root containing the first CMakeLists.txt, with build/src/extlib/include... sub folders.

I have generated cmake files in the build directory, and created the json database with the appropriate flags, here is a typical command line : "command": "/usr/bin/c++ . . . -Winvalid-pch -include /path/to/pch.hpp -std=gnu++1z -o CMakeFiles/main.dir/main.cpp.o -c /path/to/main.cpp",

Now when I open main.cpp with emacs, I get the following error message : Error from syntax checker irony: Irony-Mode server error: parse-error, "failed to parse file", "/path/to/main.cpp"

after typing some things I get

Irony I/O task: error in callback: (irony-server-error complete-error "failed to perform code completion" "path/to/main.cpp" 15 5)

From what I have tested, removing the "-include ", or the .gch file generated corrects the problem.

f-michaut commented 9 months ago

I am observing the same issue.