summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPDirectives.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-03-21 20:42:13 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-03-21 20:42:13 +0000
commit6d69fec64516de1e64882aa4452f544c7b890357 (patch)
tree15f067873cb581bcf76fb53fbe83586479ab60b5 /clang/lib/Lex/PPDirectives.cpp
parent74f0e2cc39308b992510b32d0aab25afc3572cd7 (diff)
downloadbcm5719-llvm-6d69fec64516de1e64882aa4452f544c7b890357.tar.gz
bcm5719-llvm-6d69fec64516de1e64882aa4452f544c7b890357.zip
Improve the diagnostic for #include_next occurring in a file not found
in the include path. Instead of making the incorrect claim that the included file has an absolute path, describe the actual problem: the including file was found either by absolute path, or relative to such a file, or relative to the primary source file. llvm-svn: 356712
Diffstat (limited to 'clang/lib/Lex/PPDirectives.cpp')
-rw-r--r--clang/lib/Lex/PPDirectives.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index 179b0cbf696..1850af9cfa4 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/lib/Lex/PPDirectives.cpp
@@ -2085,6 +2085,10 @@ void Preprocessor::HandleIncludeNextDirective(SourceLocation HashLoc,
LookupFromFile = CurPPLexer->getFileEntry();
Lookup = nullptr;
} else if (!Lookup) {
+ // The current file was not found by walking the include path. Either it
+ // is the primary file (handled above), or it was found by absolute path,
+ // or it was found relative to such a file.
+ // FIXME: Track enough information so we know which case we're in.
Diag(IncludeNextTok, diag::pp_include_next_absolute_path);
} else {
// Start looking up in the next directory.
OpenPOWER on IntegriCloud