I couldn't find anything in the documentation that specifies the expected behavior in each case, so I was curious and decided to look at the code in here. Might be wrong to assume this is how it will always behave, but without the documentation, I guess the source code is the next best thing.
Searching through the code I found that the #include
pragma is processed here in the HandlePragmaDependency
method (line 453), where it determines if the include isAngled
or not (line 468) and then uses that value as a parameter to the LookupFile()
method (line 477).
This method is defined in the HeaderSearch.cpp (line 498) and the documentation comment for it states that:
[...] isAngled indicates whether the file reference is for system #include's
or not (i.e. using <> instead of ""). [...]
Later in that method the value for isAngled
is used in three places (line 547, 596 and 673) each of which have the following comments.
// Unless disabled, check to see if the file is in the #includer's
// directory. This cannot be based on CurDir, because each includer could be
// a #include of a subdirectory (#include "foo/bar.h") and a subsequent
// include of "baz.h" should resolve to "whatever/foo/baz.h".
// This search is not done for <> headers.
if (!Includers.empty() && !isAngled && !NoCurDirSearch) {
...
// If this is a system #include, ignore the user #include locs.
unsigned i = isAngled ? AngledDirIdx : 0;
...
// If we are including a file with a quoted include "foo.h" from inside
// a header in a framework that is currently being built, and we couldn't
// resolve "foo.h" any other way, change the include to <Foo/foo.h>, where
// "Foo" is the name of the framework in which the including header was found.
if (!Includers.empty() && !isAngled &&
Filename.find('/') == StringRef::npos) {
Hope it helps.