summaryrefslogtreecommitdiffstats
path: root/include/clang/Basic/DiagnosticLexKinds.td
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2018-06-20 22:11:59 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2018-06-20 22:11:59 +0000
commit9b5ff2db7e31c4bb11a7d468260b068b41c7c285 (patch)
tree127aab0c5a96b581bf336a36e0aae749506e2cd7 /include/clang/Basic/DiagnosticLexKinds.td
parent39990b1e95721caf4dbe0cee68a46552f7f03dd1 (diff)
Warning for framework headers using double quote includes
Introduce -Wquoted-include-in-framework-header, which should fire a warning whenever a quote include appears in a framework header and suggest a fix-it. For instance, for header A.h added in the tests, this is how the warning looks like: ./A.framework/Headers/A.h:2:10: warning: double-quoted include "A0.h" in framework header, expected angle-bracketed instead [-Wquoted-include-in-framework-header] #include "A0.h" ^~~~~~ <A/A0.h> ./A.framework/Headers/A.h:3:10: warning: double-quoted include "B.h" in framework header, expected angle-bracketed instead [-Wquoted-include-in-framework-header] #include "B.h" ^~~~~ <B.h> This helps users to prevent frameworks from using local headers when in fact they should be targetting system level ones. The warning is off by default. Differential Revision: https://reviews.llvm.org/D47157 rdar://problem/37077034 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335184 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/DiagnosticLexKinds.td')
-rw-r--r--include/clang/Basic/DiagnosticLexKinds.td5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/clang/Basic/DiagnosticLexKinds.td b/include/clang/Basic/DiagnosticLexKinds.td
index 9b7f7e6777..de6bffcdca 100644
--- a/include/clang/Basic/DiagnosticLexKinds.td
+++ b/include/clang/Basic/DiagnosticLexKinds.td
@@ -714,6 +714,11 @@ def warn_mmap_redundant_export_as : Warning<
def err_mmap_submodule_export_as : Error<
"only top-level modules can be re-exported as public">;
+def warn_quoted_include_in_framework_header : Warning<
+ "double-quoted include \"%0\" in framework header, "
+ "expected angle-bracketed instead"
+ >, InGroup<FrameworkHdrQuotedInclude>, DefaultIgnore;
+
def warn_auto_module_import : Warning<
"treating #%select{include|import|include_next|__include_macros}0 as an "
"import of module '%1'">, InGroup<AutoImport>, DefaultIgnore;