Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions dstep/translator/HeaderIndex.d
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ class IncludeGraph

auto pair = Inclusion(headers_[includedPath], headers_[path]);
directInclusions.add(pair);
} else if (includedPath != "" && includedPath !in headers_)
{
reverse_[headers_.length] = includedPath;
headers_[includedPath] = headers_.length;
}
Comment thread
davispuh marked this conversation as resolved.
}

Expand Down
1 change: 1 addition & 0 deletions tests/functional/graph/include_known.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include <errno.h>
11 changes: 11 additions & 0 deletions tests/unit/IncludeGraphTests.d
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,14 @@ unittest

new HeaderIndex(translationUnit);
}

unittest
{
const string file = "tests/functional/graph/subfile1.h".asAbsNormPath();

auto translationUnit = makeTranslationUnit(
"tests/functional/graph/include_known.h",
["-Wno-missing-declarations", "-Itests/functional", "-include", file]);

new HeaderIndex(translationUnit);
}