blob: 86274ad0bdb97d318ebf3f8de5cd96d2c82a996c [file] [log] [blame]
Ted Kremenekc0a43772012-07-25 07:12:13 +00001RUN: diagtool list-warnings > %t 2>&1
2RUN: FileCheck --input-file=%t %s
Ted Kremenek84251262011-08-11 22:06:55 +00003
4This test serves two purposes:
5
6(1) It documents all existing warnings that currently have no associated -W flag,
7 and ensures that the list never grows.
Sylvestre Ledru1691dc42013-11-12 18:07:35 +00008
Ted Kremenek84251262011-08-11 22:06:55 +00009 If take an existing warning and add a flag, this test will fail. To
10 fix this test, simply remove that warning from the list below.
Sylvestre Ledru1691dc42013-11-12 18:07:35 +000011
Ted Kremenek84251262011-08-11 22:06:55 +000012(2) It prevents us adding new warnings to Clang that have no -W flag. All
13 new warnings should have -W flags.
Sylvestre Ledru1691dc42013-11-12 18:07:35 +000014
Ted Kremenek84251262011-08-11 22:06:55 +000015 If you add a new warning without a flag, this test will fail. To fix
16 this test, simply add a warning group to that warning.
Sylvestre Ledru1691dc42013-11-12 18:07:35 +000017
Ted Kremenek84251262011-08-11 22:06:55 +000018
19The list of warnings below should NEVER grow. It should gradually shrink to 0.
20
Pirama Arumuga Nainar33337ca2015-05-06 11:48:57 -070021CHECK: Warnings without flags (93):
Stephen Hines176edba2014-12-01 14:53:08 -080022CHECK-NEXT: ext_excess_initializers
23CHECK-NEXT: ext_excess_initializers_in_char_array_initializer
Ted Kremenekbb5185c2012-08-10 20:50:00 +000024CHECK-NEXT: ext_expected_semi_decl_list
25CHECK-NEXT: ext_explicit_specialization_storage_class
26CHECK-NEXT: ext_implicit_lib_function_decl
Stephen Hines176edba2014-12-01 14:53:08 -080027CHECK-NEXT: ext_initializer_string_for_char_array_too_long
Ted Kremenekbb5185c2012-08-10 20:50:00 +000028CHECK-NEXT: ext_missing_declspec
29CHECK-NEXT: ext_missing_whitespace_after_macro_name
30CHECK-NEXT: ext_new_paren_array_nonconst
31CHECK-NEXT: ext_plain_complex
Ted Kremenekbb5185c2012-08-10 20:50:00 +000032CHECK-NEXT: ext_template_arg_extra_parens
Ted Kremenekbb5185c2012-08-10 20:50:00 +000033CHECK-NEXT: ext_typecheck_comparison_of_pointer_integer
34CHECK-NEXT: ext_typecheck_cond_incompatible_operands
35CHECK-NEXT: ext_typecheck_cond_incompatible_operands_nonstandard
36CHECK-NEXT: ext_typecheck_ordered_comparison_of_function_pointers
37CHECK-NEXT: ext_typecheck_ordered_comparison_of_pointer_integer
Ted Kremenekbb5185c2012-08-10 20:50:00 +000038CHECK-NEXT: ext_using_undefined_std
Ted Kremenek84251262011-08-11 22:06:55 +000039CHECK-NEXT: pp_include_next_absolute_path
40CHECK-NEXT: pp_include_next_in_primary
41CHECK-NEXT: pp_invalid_string_literal
42CHECK-NEXT: pp_out_of_date_dependency
43CHECK-NEXT: pp_poisoning_existing_macro
44CHECK-NEXT: pp_pragma_once_in_main_file
45CHECK-NEXT: pp_pragma_sysheader_in_main_file
Ted Kremenek84251262011-08-11 22:06:55 +000046CHECK-NEXT: w_asm_qualifier_ignored
47CHECK-NEXT: warn_accessor_property_type_mismatch
48CHECK-NEXT: warn_anon_bitfield_width_exceeds_type_size
Stephen Hines6bcf27b2014-05-29 04:14:42 -070049CHECK-NEXT: warn_arcmt_nsalloc_realloc
Ted Kremenek84251262011-08-11 22:06:55 +000050CHECK-NEXT: warn_asm_label_on_auto_decl
Ted Kremenek84251262011-08-11 22:06:55 +000051CHECK-NEXT: warn_bitfield_width_exceeds_type_size
Ted Kremenek84251262011-08-11 22:06:55 +000052CHECK-NEXT: warn_c_kext
53CHECK-NEXT: warn_call_to_pure_virtual_member_function_from_ctor_dtor
54CHECK-NEXT: warn_call_wrong_number_of_arguments
55CHECK-NEXT: warn_case_empty_range
Ted Kremenek84251262011-08-11 22:06:55 +000056CHECK-NEXT: warn_char_constant_too_large
Ted Kremenek84251262011-08-11 22:06:55 +000057CHECK-NEXT: warn_collection_expr_type
Ted Kremenek84251262011-08-11 22:06:55 +000058CHECK-NEXT: warn_conflicting_variadic
59CHECK-NEXT: warn_conv_to_base_not_used
60CHECK-NEXT: warn_conv_to_self_not_used
61CHECK-NEXT: warn_conv_to_void_not_used
Ted Kremenek84251262011-08-11 22:06:55 +000062CHECK-NEXT: warn_delete_array_type
Ted Kremenek84251262011-08-11 22:06:55 +000063CHECK-NEXT: warn_double_const_requires_fp64
64CHECK-NEXT: warn_drv_assuming_mfloat_abi_is
65CHECK-NEXT: warn_drv_clang_unsupported
Ted Kremenek84251262011-08-11 22:06:55 +000066CHECK-NEXT: warn_drv_objc_gc_unsupported
67CHECK-NEXT: warn_drv_pch_not_first_include
Ted Kremenek84251262011-08-11 22:06:55 +000068CHECK-NEXT: warn_dup_category_def
69CHECK-NEXT: warn_duplicate_protocol_def
Ted Kremenek84251262011-08-11 22:06:55 +000070CHECK-NEXT: warn_enum_value_overflow
Ted Kremenekbb5185c2012-08-10 20:50:00 +000071CHECK-NEXT: warn_expected_qualified_after_typename
Ted Kremenek84251262011-08-11 22:06:55 +000072CHECK-NEXT: warn_extraneous_char_constant
73CHECK-NEXT: warn_fe_cc_log_diagnostics_failure
74CHECK-NEXT: warn_fe_cc_print_header_failure
75CHECK-NEXT: warn_fe_macro_contains_embedded_newline
76CHECK-NEXT: warn_file_asm_volatile
Ted Kremenek84251262011-08-11 22:06:55 +000077CHECK-NEXT: warn_ignoring_ftabstop_value
Ted Kremenek84251262011-08-11 22:06:55 +000078CHECK-NEXT: warn_implements_nscopying
Ted Kremenek84251262011-08-11 22:06:55 +000079CHECK-NEXT: warn_incompatible_qualified_id
Ted Kremenek84251262011-08-11 22:06:55 +000080CHECK-NEXT: warn_inline_namespace_reopened_noninline
Ted Kremenek84251262011-08-11 22:06:55 +000081CHECK-NEXT: warn_invalid_asm_cast_lvalue
Ted Kremenek84251262011-08-11 22:06:55 +000082CHECK-NEXT: warn_maynot_respond
Ted Kremenek84251262011-08-11 22:06:55 +000083CHECK-NEXT: warn_method_param_redefinition
Ted Kremenek84251262011-08-11 22:06:55 +000084CHECK-NEXT: warn_missing_case_for_condition
Ted Kremenekbb5185c2012-08-10 20:50:00 +000085CHECK-NEXT: warn_missing_dependent_template_keyword
Ted Kremenek84251262011-08-11 22:06:55 +000086CHECK-NEXT: warn_missing_exception_specification
87CHECK-NEXT: warn_missing_whitespace_after_macro_name
Stephen Hines651f13c2014-04-23 16:59:28 -070088CHECK-NEXT: warn_mt_message
Ted Kremenek84251262011-08-11 22:06:55 +000089CHECK-NEXT: warn_no_constructor_for_refconst
Ted Kremenek84251262011-08-11 22:06:55 +000090CHECK-NEXT: warn_not_compound_assign
Ted Kremenek84251262011-08-11 22:06:55 +000091CHECK-NEXT: warn_objc_property_copy_missing_on_block
Ted Kremenek84251262011-08-11 22:06:55 +000092CHECK-NEXT: warn_objc_protocol_qualifier_missing_id
Ted Kremenek84251262011-08-11 22:06:55 +000093CHECK-NEXT: warn_on_superclass_use
Ted Kremenek84251262011-08-11 22:06:55 +000094CHECK-NEXT: warn_partial_specs_not_deducible
Ted Kremenek84251262011-08-11 22:06:55 +000095CHECK-NEXT: warn_pp_convert_lhs_to_positive
96CHECK-NEXT: warn_pp_convert_rhs_to_positive
97CHECK-NEXT: warn_pp_expr_overflow
Ted Kremenek84251262011-08-11 22:06:55 +000098CHECK-NEXT: warn_pp_line_decimal
Ted Kremenek84251262011-08-11 22:06:55 +000099CHECK-NEXT: warn_pragma_pack_pop_identifer_and_alignment
100CHECK-NEXT: warn_pragma_pack_show
Ted Kremenek84251262011-08-11 22:06:55 +0000101CHECK-NEXT: warn_property_getter_owning_mismatch
Ted Kremenek84251262011-08-11 22:06:55 +0000102CHECK-NEXT: warn_register_objc_catch_parm
103CHECK-NEXT: warn_related_result_type_compatibility_class
104CHECK-NEXT: warn_related_result_type_compatibility_protocol
Ted Kremenek84251262011-08-11 22:06:55 +0000105CHECK-NEXT: warn_template_export_unsupported
106CHECK-NEXT: warn_template_spec_extra_headers
107CHECK-NEXT: warn_tentative_incomplete_array
Ted Kremenek84251262011-08-11 22:06:55 +0000108CHECK-NEXT: warn_typecheck_function_qualifiers
Ted Kremenek84251262011-08-11 22:06:55 +0000109CHECK-NEXT: warn_undef_interface
110CHECK-NEXT: warn_undef_interface_suggest
111CHECK-NEXT: warn_undef_protocolref
Ted Kremenek84251262011-08-11 22:06:55 +0000112CHECK-NEXT: warn_use_out_of_scope_declaration
113CHECK-NEXT: warn_weak_identifier_undeclared
114CHECK-NEXT: warn_weak_import
Ted Kremeneke8cf7d12012-07-07 05:53:30 +0000115
Richard Smitheab9d6f2012-07-23 05:45:25 +0000116The list of warnings in -Wpedantic should NEVER grow.
Ted Kremeneka437b842012-07-07 06:30:31 +0000117
Eli Friedman5f33c372013-09-18 23:23:17 +0000118CHECK: Number in -Wpedantic (not covered by other -W flags): 28