Author: rsmith Date: Mon Oct 12 16:05:54 2015 New Revision: 250105 URL: http://llvm.org/viewvc/llvm-project?rev=250105&view=rev Log: Add warning flags for #include_next and some nearby warnings.
Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td cfe/trunk/test/Misc/warning-flags.c Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?rev=250105&r1=250104&r2=250105&view=diff ============================================================================== --- cfe/trunk/include/clang/Basic/DiagnosticGroups.td (original) +++ cfe/trunk/include/clang/Basic/DiagnosticGroups.td Mon Oct 12 16:05:54 2015 @@ -202,6 +202,7 @@ def InfiniteRecursion : DiagGroup<"infin def GNUImaginaryConstant : DiagGroup<"gnu-imaginary-constant">; def IgnoredQualifiers : DiagGroup<"ignored-qualifiers">; def : DiagGroup<"import">; +def GNUIncludeNext : DiagGroup<"gnu-include-next">; def IncompatibleMSStruct : DiagGroup<"incompatible-ms-struct">; def IncompatiblePointerTypesDiscardsQualifiers : DiagGroup<"incompatible-pointer-types-discards-qualifiers">; @@ -708,7 +709,8 @@ def GNU : DiagGroup<"gnu", [GNUAlignofEx GNUEmptyInitializer, GNUEmptyStruct, VLAExtension, GNUFlexibleArrayInitializer, GNUFlexibleArrayUnionMember, GNUFoldingConstant, - GNUImaginaryConstant, GNULabelsAsValue, + GNUImaginaryConstant, GNUIncludeNext, + GNULabelsAsValue, RedeclaredClassMember, GNURedeclaredEnum, GNUStatementExpression, GNUStaticFloatInit, GNUStringLiteralOperatorTemplate, Modified: cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td?rev=250105&r1=250104&r2=250105&view=diff ============================================================================== --- cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td (original) +++ cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td Mon Oct 12 16:05:54 2015 @@ -256,10 +256,13 @@ def err_pp_hash_error : Error<"%0">; } def pp_include_next_in_primary : Warning< - "#include_next in primary source file">; + "#include_next in primary source file">, + InGroup<DiagGroup<"include-next-outside-header">>; def pp_include_macros_out_of_predefines : Error< "the #__include_macros directive is only for internal use by -imacros">; -def pp_include_next_absolute_path : Warning<"#include_next with absolute path">; +def pp_include_next_absolute_path : Warning< + "#include_next with absolute path">, + InGroup<DiagGroup<"include-next-absolute-path">>; def ext_c99_whitespace_required_after_macro_name : ExtWarn< "ISO C99 requires whitespace after the macro name">, InGroup<C99>; def ext_missing_whitespace_after_macro_name : ExtWarn< @@ -267,9 +270,11 @@ def ext_missing_whitespace_after_macro_n def warn_missing_whitespace_after_macro_name : Warning< "whitespace recommended after macro name">; -def pp_pragma_once_in_main_file : Warning<"#pragma once in main file">; +def pp_pragma_once_in_main_file : Warning<"#pragma once in main file">, + InGroup<DiagGroup<"pragma-once-outside-header">>; def pp_pragma_sysheader_in_main_file : Warning< - "#pragma system_header ignored in main file">; + "#pragma system_header ignored in main file">, + InGroup<DiagGroup<"pragma-system-header-outside-header">>; def pp_poisoning_existing_macro : Warning<"poisoning existing macro">; def pp_out_of_date_dependency : Warning< "current file is older than dependency %0">; @@ -316,7 +321,7 @@ def ext_pp_include_search_ms : ExtWarn< def ext_pp_ident_directive : Extension<"#ident is a language extension">; def ext_pp_include_next_directive : Extension< - "#include_next is a language extension">; + "#include_next is a language extension">, InGroup<GNUIncludeNext>; def ext_pp_warning_directive : Extension<"#warning is a language extension">; def ext_pp_extra_tokens_at_eol : ExtWarn< Modified: cfe/trunk/test/Misc/warning-flags.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/warning-flags.c?rev=250105&r1=250104&r2=250105&view=diff ============================================================================== --- cfe/trunk/test/Misc/warning-flags.c (original) +++ cfe/trunk/test/Misc/warning-flags.c Mon Oct 12 16:05:54 2015 @@ -18,7 +18,7 @@ This test serves two purposes: The list of warnings below should NEVER grow. It should gradually shrink to 0. -CHECK: Warnings without flags (89): +CHECK: Warnings without flags (85): CHECK-NEXT: ext_excess_initializers CHECK-NEXT: ext_excess_initializers_in_char_array_initializer CHECK-NEXT: ext_expected_semi_decl_list @@ -35,13 +35,9 @@ CHECK-NEXT: ext_typecheck_cond_incompa CHECK-NEXT: ext_typecheck_ordered_comparison_of_function_pointers CHECK-NEXT: ext_typecheck_ordered_comparison_of_pointer_integer CHECK-NEXT: ext_using_undefined_std -CHECK-NEXT: pp_include_next_absolute_path -CHECK-NEXT: pp_include_next_in_primary CHECK-NEXT: pp_invalid_string_literal CHECK-NEXT: pp_out_of_date_dependency CHECK-NEXT: pp_poisoning_existing_macro -CHECK-NEXT: pp_pragma_once_in_main_file -CHECK-NEXT: pp_pragma_sysheader_in_main_file CHECK-NEXT: w_asm_qualifier_ignored CHECK-NEXT: warn_accessor_property_type_mismatch CHECK-NEXT: warn_arcmt_nsalloc_realloc @@ -111,4 +107,4 @@ CHECK-NEXT: warn_weak_import The list of warnings in -Wpedantic should NEVER grow. -CHECK: Number in -Wpedantic (not covered by other -W flags): 28 +CHECK: Number in -Wpedantic (not covered by other -W flags): 27 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits