Move about 20 random diagnostics under -W flags. Patch by Ahmed Charles!

llvm-svn: 142284
This commit is contained in:
Ted Kremenek 2011-10-17 21:47:53 +00:00
parent a9dbf4325e
commit a08713ce86
6 changed files with 38 additions and 39 deletions

View File

@ -29,6 +29,7 @@ def BoolConversions : DiagGroup<"bool-conversions">;
def CXXCompat: DiagGroup<"c++-compat">;
def CastAlign : DiagGroup<"cast-align">;
def : DiagGroup<"cast-qual">;
def CatchIncompleteExtension : DiagGroup<"catch-incomplete-type-extensions">;
def : DiagGroup<"char-align">;
def Comment : DiagGroup<"comment">;
def : DiagGroup<"ctor-dtor-privacy">;
@ -66,6 +67,7 @@ def : DiagGroup<"c++0x-compat", [CXX11Compat]>;
def : DiagGroup<"effc++">;
def ExitTimeDestructors : DiagGroup<"exit-time-destructors">;
def FlexibleArrayExtensions : DiagGroup<"flexible-array-extensions">;
def FourByteMultiChar : DiagGroup<"four-char-constants">;
def GlobalConstructors : DiagGroup<"global-constructors">;
def : DiagGroup<"idiomatic-parentheses">;
@ -94,6 +96,7 @@ def LongLong : DiagGroup<"long-long">;
def MismatchedTags : DiagGroup<"mismatched-tags">;
def MissingFieldInitializers : DiagGroup<"missing-field-initializers">;
def ModuleBuild : DiagGroup<"module-build">;
def NullCharacter : DiagGroup<"null-character">;
def NullDereference : DiagGroup<"null-dereference">;
def InitializerOverrides : DiagGroup<"initializer-overrides">;
def NonNull : DiagGroup<"nonnull">;
@ -161,6 +164,7 @@ def Switch : DiagGroup<"switch", [SwitchEnum]>;
def Trigraphs : DiagGroup<"trigraphs">;
def : DiagGroup<"type-limits">;
def Unicode : DiagGroup<"unicode">;
def Uninitialized : DiagGroup<"uninitialized">;
def UninitializedMaybe : DiagGroup<"conditional-uninitialized">;
def UnknownPragmas : DiagGroup<"unknown-pragmas">;
@ -320,6 +324,9 @@ def DelegatingCtorCycles :
// A warning group for warnings about using C1X features as extensions.
def C1X : DiagGroup<"c1x-extensions">;
// A warning group for warnings about using C99 features as extensions.
def C99 : DiagGroup<"c99-extensions">;
// A warning group for warnings about GCC extensions.
def GNU : DiagGroup<"gnu", [GNUDesignator, VLA]>;

View File

@ -13,16 +13,19 @@
let Component = "Lex", CategoryName = "Lexical or Preprocessor Issue" in {
def null_in_string : Warning<"null character(s) preserved in string literal">;
def null_in_char : Warning<"null character(s) preserved in character literal">;
def null_in_file : Warning<"null character ignored">;
def null_in_string : Warning<"null character(s) preserved in string literal">,
InGroup<NullCharacter>;
def null_in_char : Warning<"null character(s) preserved in character literal">,
InGroup<NullCharacter>;
def null_in_file : Warning<"null character ignored">, InGroup<NullCharacter>;
def warn_nested_block_comment : Warning<"'/*' within block comment">,
InGroup<Comment>;
def escaped_newline_block_comment_end : Warning<
"escaped newline between */ characters at block comment end">,
InGroup<Comment>;
def backslash_newline_space : Warning<
"backslash and newline separated by space">;
"backslash and newline separated by space">,
InGroup<DiagGroup<"backslash-newline-escape">>;
// Digraphs.
def warn_cxx98_compat_less_colon_colon : Warning<
@ -45,8 +48,10 @@ def ext_bcpl_comment : Extension<
InGroup<Comment>;
def ext_no_newline_eof : Extension<"no newline at end of file">,
InGroup<DiagGroup<"newline-eof">>;
def ext_dollar_in_identifier : Extension<"'$' in identifier">;
def charize_microsoft_ext : Extension<"@# is a microsoft extension">;
def ext_dollar_in_identifier : Extension<"'$' in identifier">,
InGroup<DiagGroup<"dollar-in-identifier-extension">>;
def ext_charize_microsoft : Extension<"@# is a microsoft extension">,
InGroup<Microsoft>;
def ext_token_used : Extension<"extension used">,
InGroup<DiagGroup<"language-extension-token">>;
@ -117,9 +122,9 @@ def ext_string_too_long : Extension<"string literal of length %0 exceeds "
"maximum length %1 that %select{C90|ISO C99|C++}2 compilers are required to "
"support">, InGroup<OverlengthStrings>;
def warn_ucn_escape_too_large : ExtWarn<
"character unicode escape sequence too long for its type">;
"character unicode escape sequence too long for its type">, InGroup<Unicode>;
def warn_ucn_not_valid_in_c89 : ExtWarn<
"unicode escape sequences are only valid in C99 or C++">;
"unicode escape sequences are only valid in C99 or C++">, InGroup<Unicode>;
def warn_cxx98_compat_unicode_literal : Warning<
"unicode literals are incompatible with C++98">,
InGroup<CXX98Compat>, DefaultIgnore;
@ -145,7 +150,7 @@ 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 ext_c99_whitespace_required_after_macro_name : ExtWarn<
"ISO C99 requires whitespace after the macro name">;
"ISO C99 requires whitespace after the macro name">, InGroup<C99>;
def ext_missing_whitespace_after_macro_name : ExtWarn<
"whitespace required after macro name">;
def warn_missing_whitespace_after_macro_name : Warning<

View File

@ -52,9 +52,9 @@ def err_friend_storage_spec : Error<"'%0' is invalid in friend declarations">;
def ext_ident_list_in_param : Extension<
"type-less parameter names in function declaration">;
def ext_c99_variable_decl_in_for_loop : Extension<
"variable declaration in for loop is a C99-specific feature">;
"variable declaration in for loop is a C99-specific feature">, InGroup<C99>;
def ext_c99_compound_literal : Extension<
"compound literals are a C99-specific feature">;
"compound literals are a C99-specific feature">, InGroup<C99>;
def ext_enumerator_list_comma : Extension<
"commas at the end of enumerator lists are a %select{C99|C++11}0-specific "
"feature">;
@ -228,7 +228,7 @@ def warn_auto_storage_class : Warning<
InGroup<CXX11Compat>;
def ext_auto_storage_class : ExtWarn<
"'auto' storage class specifier is not permitted in C++11, and will not "
"be supported in future releases">;
"be supported in future releases">, InGroup<DiagGroup<"auto-storage-class">>;
def ext_for_range : ExtWarn<
"range-based for loop is a C++11 extension">, InGroup<CXX11>;
def warn_cxx98_compat_for_range : Warning<

View File

@ -2899,9 +2899,11 @@ def err_flexible_array_empty_struct : Error<
def err_flexible_array_has_nonpod_type : Error<
"flexible array member %0 of non-POD element type %1">;
def ext_flexible_array_in_struct : Extension<
"%0 may not be nested in a struct due to flexible array member">;
"%0 may not be nested in a struct due to flexible array member">,
InGroup<FlexibleArrayExtensions>;
def ext_flexible_array_in_array : Extension<
"%0 may not be used as an array element due to flexible array member">;
"%0 may not be used as an array element due to flexible array member">,
InGroup<FlexibleArrayExtensions>;
def err_flexible_array_init : Error<
"initialization of flexible array member is not allowed">;
def ext_flexible_array_empty_aggregate_ms : Extension<
@ -3707,7 +3709,8 @@ def ext_delete_void_ptr_operand : ExtWarn<
def err_ambiguous_delete_operand : Error<"ambiguous conversion of delete "
"expression of type %0 to a pointer">;
def warn_delete_incomplete : Warning<
"deleting pointer to incomplete type %0 may cause undefined behaviour">;
"deleting pointer to incomplete type %0 may cause undefined behaviour">,
InGroup<DiagGroup<"delete-incomplete">>;
def err_delete_incomplete_class_type : Error<
"deleting incomplete class type %0; no conversions to pointer type">;
def warn_delete_array_type : Warning<
@ -3722,9 +3725,11 @@ def err_decrement_bool : Error<"cannot decrement expression of type bool">;
def warn_increment_bool : Warning<
"incrementing expression of type bool is deprecated">, InGroup<Deprecated>;
def ext_catch_incomplete_ptr : ExtWarn<
"ISO C++ forbids catching a pointer to incomplete type %0">;
"ISO C++ forbids catching a pointer to incomplete type %0">,
InGroup<CatchIncompleteExtension>;
def ext_catch_incomplete_ref : ExtWarn<
"ISO C++ forbids catching a reference to incomplete type %0">;
"ISO C++ forbids catching a reference to incomplete type %0">,
InGroup<CatchIncompleteExtension>;
def err_catch_incomplete : Error<"cannot catch incomplete type %0">;
def err_catch_rvalue_ref : Error<"cannot catch exceptions by rvalue reference">;
def err_qualified_catch_declarator : Error<
@ -4789,7 +4794,7 @@ def err_missing_param_declspec : Error<
def err_objc_array_of_interfaces : Error<
"array of interface %0 is invalid (probably should be an array of pointers)">;
def ext_c99_array_usage : Extension<
"use of C99-specific array features, accepted as an extension">;
"use of C99-specific array features, accepted as an extension">, InGroup<C99>;
def err_c99_array_usage_cxx : Error<
"C99-specific array features are not permitted in C++">;
def err_double_requires_fp64 : Error<

View File

@ -2737,7 +2737,7 @@ LexNextToken:
} else if (Char == '@' && Features.MicrosoftExt) {// %:@ -> #@ -> Charize
CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
if (!isLexingRawMode())
Diag(BufferPtr, diag::charize_microsoft_ext);
Diag(BufferPtr, diag::ext_charize_microsoft);
Kind = tok::hashat;
} else { // '%:' -> '#'
// We parsed a # character. If this occurs at the start of the line,
@ -2921,7 +2921,7 @@ LexNextToken:
} else if (Char == '@' && Features.MicrosoftExt) { // #@ -> Charize
Kind = tok::hashat;
if (!isLexingRawMode())
Diag(BufferPtr, diag::charize_microsoft_ext);
Diag(BufferPtr, diag::ext_charize_microsoft);
CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
} else {
// We parsed a # character. If this occurs at the start of the line,

View File

@ -17,25 +17,15 @@ This test serves two purposes:
The list of warnings below should NEVER grow. It should gradually shrink to 0.
CHECK: Warnings without flags (297):
CHECK-NEXT: backslash_newline_space
CHECK-NEXT: charize_microsoft_ext
CHECK: Warnings without flags (279):
CHECK-NEXT: ext_anon_param_requires_type_specifier
CHECK-NEXT: ext_anonymous_struct_union_qualified
CHECK-NEXT: ext_array_init_copy
CHECK-NEXT: ext_auto_storage_class
CHECK-NEXT: ext_binary_literal
CHECK-NEXT: ext_c99_array_usage
CHECK-NEXT: ext_c99_compound_literal
CHECK-NEXT: ext_c99_variable_decl_in_for_loop
CHECK-NEXT: ext_c99_whitespace_required_after_macro_name
CHECK-NEXT: ext_cast_fn_obj
CHECK-NEXT: ext_catch_incomplete_ptr
CHECK-NEXT: ext_catch_incomplete_ref
CHECK-NEXT: ext_delete_void_ptr_operand
CHECK-NEXT: ext_designated_init
CHECK-NEXT: ext_designated_init_cxx
CHECK-NEXT: ext_dollar_in_identifier
CHECK-NEXT: ext_duplicate_declspec
CHECK-NEXT: ext_ellipsis_exception_spec
CHECK-NEXT: ext_embedded_directive
@ -50,8 +40,6 @@ CHECK-NEXT: ext_explicit_specialization_storage_class
CHECK-NEXT: ext_expr_not_ice
CHECK-NEXT: ext_extra_ivar_semi
CHECK-NEXT: ext_extra_struct_semi
CHECK-NEXT: ext_flexible_array_in_array
CHECK-NEXT: ext_flexible_array_in_struct
CHECK-NEXT: ext_forward_ref_enum
CHECK-NEXT: ext_freestanding_complex
CHECK-NEXT: ext_hexconstant_invalid
@ -106,9 +94,6 @@ CHECK-NEXT: ext_typecheck_zero_array_size
CHECK-NEXT: ext_unknown_escape
CHECK-NEXT: ext_using_undefined_std
CHECK-NEXT: ext_vla_folded_to_constant
CHECK-NEXT: null_in_char
CHECK-NEXT: null_in_file
CHECK-NEXT: null_in_string
CHECK-NEXT: pp_include_next_absolute_path
CHECK-NEXT: pp_include_next_in_primary
CHECK-NEXT: pp_invalid_string_literal
@ -163,7 +148,6 @@ CHECK-NEXT: warn_conv_to_void_not_used
CHECK-NEXT: warn_cxx0x_right_shift_in_template_arg
CHECK-NEXT: warn_decl_in_param_list
CHECK-NEXT: warn_delete_array_type
CHECK-NEXT: warn_delete_incomplete
CHECK-NEXT: warn_division_by_zero
CHECK-NEXT: warn_double_const_requires_fp64
CHECK-NEXT: warn_drv_assuming_mfloat_abi_is
@ -300,8 +284,6 @@ CHECK-NEXT: warn_transparent_union_attribute_not_definition
CHECK-NEXT: warn_transparent_union_attribute_zero_fields
CHECK-NEXT: warn_transparent_union_nonpointer
CHECK-NEXT: warn_typecheck_function_qualifiers
CHECK-NEXT: warn_ucn_escape_too_large
CHECK-NEXT: warn_ucn_not_valid_in_c89
CHECK-NEXT: warn_unavailable_fwdclass_message
CHECK-NEXT: warn_undef_interface
CHECK-NEXT: warn_undef_interface_suggest