[cfe-dev] fatal error while reparsing translation unit: file '/some/path/to/header' has been modified since the precompiled header '/tmp/preamble-8ae0ef.pch' was built

Dan Schmidt dcschmid at gmail.com
Mon Jun 16 05:07:55 PDT 2014


Hello clang devs,

I use YouCompleteMe as a semantic completion engine for vim, which in turn
uses libclang to provide completions. By default, YCM uses the 3.4 version
of libclang, and all works well. However, I recently updated it to use the
head version and now I'm seeing errors like that listed in the subject.
I've been able to create a minimal reproduction - see the attached files.

To execute run commands similar to the following:

   - tar xvf clang_parse.tar.gz
   - cd clang_parse
   - mkdir obj
   - cd obj
   - cmake -D CMAKE_BUILD_TYPE=Release -G "Unix Makefiles" -D
   PATH_TO_LLVM_ROOT=<path to llvm head install dir - should have include and
   lib under here> ../src/
   - make
   - ./parse_tu

The basic test case is this:

   - Write the small cpp and h files to disk.
   - Parse the translation unit - observe that the syntax error is reported
   - Immediately reparse the TU.
   - Update the header in memory and reparse - observe that the syntax
   error is gone.
   - Save the header to disk and reparse. Observe the "file
   '/tmp/header_file.h' has been modified since the precompiled header
   '/some/path/preamble-eb3c0c.pch' was built" error.

Am I using these methods incorrectly, or is there a bug in clang? If I'm
using them incorrectly, what is the correct way to reparse a translation
unit that has changed?

Thanks,
Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140616/744b7aa4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang_parse.tar.gz
Type: application/x-gzip
Size: 1603 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140616/744b7aa4/attachment.bin>


More information about the cfe-dev mailing list