From 6d69fec64516de1e64882aa4452f544c7b890357 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 21 Mar 2019 20:42:13 +0000 Subject: 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 --- clang/lib/Lex/PPDirectives.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/lib/Lex/PPDirectives.cpp') 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. -- cgit v1.2.3