summaryrefslogtreecommitdiffstats
path: root/clang/test/Preprocessor/empty_file_to_include.h
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2018-09-13 21:10:08 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2018-09-13 21:10:08 +0000
commit2ce63b4246329ee0fb20aa6f768f1f57eda6d5f0 (patch)
tree4be210b1e56cdc21224b46cb709dbf767159f538 /clang/test/Preprocessor/empty_file_to_include.h
parent2f88006cedd06b8e2be1e9d282ba7e3bf88f57ca (diff)
downloadbcm5719-llvm-2ce63b4246329ee0fb20aa6f768f1f57eda6d5f0.tar.gz
bcm5719-llvm-2ce63b4246329ee0fb20aa6f768f1f57eda6d5f0.zip
Diagnose likely typos in #include directives.
Summary: When someone writes #include "<some_file>" or #include " some_file " the compiler returns "file not fuond..." with fonts and quotes that may make it hard to see there are excess quotes or surprising bytes in the filename. Assuming that files are usually logically named and start and end with an alphanumeric character, we can check for the file's existence by stripping the non-alphanumeric leading or trailing characters. If the file is found, emit a non-fatal error with a FixItHint. Patch by Christy Lee! Reviewers: aaron.ballman, erikjv, rsmith Reviewed By: rsmith Subscribers: lebedev.ri, xbolva00, sammccall, modocache, erikjv, aaron.ballman, cfe-commits Differential Revision: https://reviews.llvm.org/D51333 llvm-svn: 342177
Diffstat (limited to 'clang/test/Preprocessor/empty_file_to_include.h')
-rw-r--r--clang/test/Preprocessor/empty_file_to_include.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/Preprocessor/empty_file_to_include.h b/clang/test/Preprocessor/empty_file_to_include.h
new file mode 100644
index 00000000000..48ffc751538
--- /dev/null
+++ b/clang/test/Preprocessor/empty_file_to_include.h
@@ -0,0 +1,7 @@
+
+#ifndef EMPTY_FILE_TO_INCLUDE_H
+#define EMPTY_FILE_TO_INCLUDE_H
+
+// empty file
+
+#endif
OpenPOWER on IntegriCloud