summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Lex/PPDirectives.cpp3
-rw-r--r--clang/test/Preprocessor/missing-include-range-check.h8
2 files changed, 10 insertions, 1 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index 22d6cc96061..3bfbf16ae3b 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/lib/Lex/PPDirectives.cpp
@@ -1847,7 +1847,8 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc,
// If the file is still not found, just go with the vanilla diagnostic
if (!File)
- Diag(FilenameTok, diag::err_pp_file_not_found) << Filename;
+ Diag(FilenameTok, diag::err_pp_file_not_found) << Filename
+ << FilenameRange;
}
}
diff --git a/clang/test/Preprocessor/missing-include-range-check.h b/clang/test/Preprocessor/missing-include-range-check.h
new file mode 100644
index 00000000000..6b3f7d35612
--- /dev/null
+++ b/clang/test/Preprocessor/missing-include-range-check.h
@@ -0,0 +1,8 @@
+// RUN: env CINDEXTEST_KEEP_GOING=1 c-index-test -test-load-source all %s > /dev/null 2> %t.err
+// RUN: FileCheck < %t.err -check-prefix=CHECK-RANGE %s
+
+#include <foobar.h>
+#include "moozegnarf.h"
+
+// CHECK-RANGE: rewrite-includes-missing.c:4:10:{4:10-4:19}: fatal error: 'foobar.h' file not found
+// CHECK-RANGE: rewrite-includes-missing.c:5:10:{5:10-5:24}: fatal error: 'moozegnarf.h' file not found
OpenPOWER on IntegriCloud