Is Xcode autocomplete not supposed to work in standalone c++ header files?

I was creating an abstract class for my game objects in xcode, so no accompanying source file was neccessary. I didn't think this would be a problem, but it seems that the header file is only indexed when it is include in a file that is either a source file or linked to a source file. I thought this was peculiar seeing as it can't be that uncommon to have a standalone header file. If anyone has any insight this, I would be very greatful!

Even the abstract class header file will have to be included in something in some chain of files that is eventually included in one or more source files. Not sure what you mean by a "standalone header file."


I think in order to build the indexing database, the clang compiler is actually invoked to do static analysis on the source files. Header files to have to be eventually included in at least one source file in order to be compiled. clang/clang++ does not compile header files except when building module map files, but, they are not part of the static analysis.


The #include directive is only a pre-processing directive. It allows the compiler to "cut-and-paste" code as part of the compilation process, but, it has to be compiling a source file (or .pch file, which can be considered a source file) in order to do the cutting and pasting.

When I refer to a "standalone header file" I am meaning that the header file is not included by any other file, source or header. What I was saying that it was peculiar was that a header had to be paired with a source file, through an #include directive, in order for indexing to pick it up and activate highlighting.

Is Xcode autocomplete not supposed to work in standalone c++ header files?
 
 
Q