Since clang 5.0 (and currently in master), libclang reports "unterminated conditional directive" when an "include guarded" file transitively includes itself. Or at least that's how it appears.
There are two simple test cases, both of which compile fine when not in "editing" mode, but raise "unterminated conditional directive" when building a preamble.
Since clang 5.0 (and currently in master), libclang reports "unterminated conditional directive" when an "include guarded" file transitively includes itself. Or at least that's how it appears.
There are two simple test cases, both of which compile fine when not in "editing" mode, but raise "unterminated conditional directive" when building a preamble.
More info: https://github.com/Valloric/YouCompleteMe/issues/2795
Tests reproduced with both clang 5.0 prebuilt binaries and a build of master as of yesterday (Sat 21st October).
Test case 1: Header includes itself.
Normal compilation
In editing mode:
Test case 2 (perhaps more realistic in editor scenarios, where users use
-include b.h
to make completion work withina.h
):Again, compilation is fine until using the editor flags:
I suspect (truly a guess), that this commit is the culprit, though I haven't proven it: https://reviews.llvm.org/D15994#95a083c2