def Uninitialized : DiagGroup<"uninitialized", [UninitializedSometimes,
UninitializedStaticSelfInit]>;
def UnknownPragmas : DiagGroup<"unknown-pragmas">;
+def IgnoredPragmas : DiagGroup<"ignored-pragmas">;
+def Pragmas : DiagGroup<"pragmas", [UnknownPragmas, IgnoredPragmas]>;
def UnknownWarningOption : DiagGroup<"unknown-warning-option">;
def NSobjectAttribute : DiagGroup<"NSObject-attribute">;
def UnknownAttributes : DiagGroup<"unknown-attributes">;
def err_pragma_push_pop_macro_malformed : Error<
"pragma %0 requires a parenthesized string">;
def warn_pragma_pop_macro_no_push : Warning<
- "pragma pop_macro could not pop '%0', no matching push_macro">;
+ "pragma pop_macro could not pop '%0', no matching push_macro">,
+ InGroup<IgnoredPragmas>;
def warn_pragma_message : Warning<"%0">,
InGroup<PoundPragmaMessage>, DefaultWarnNoWerror;
def err_pragma_message : Error<"%0">;
InGroup<UnknownPragmas>;
// - #pragma __debug
def warn_pragma_debug_unexpected_command : Warning<
- "unexpected debug command '%0'">;
+ "unexpected debug command '%0'">, InGroup<IgnoredPragmas>;
def err_defined_macro_name : Error<"'defined' cannot be used as a macro name">;
def err_paste_at_start : Error<
// Language specific pragmas
// - Generic warnings
def warn_pragma_expected_lparen : Warning<
- "missing '(' after '#pragma %0' - ignoring">;
+ "missing '(' after '#pragma %0' - ignoring">, InGroup<IgnoredPragmas>;
def warn_pragma_expected_rparen : Warning<
- "missing ')' after '#pragma %0' - ignoring">;
+ "missing ')' after '#pragma %0' - ignoring">, InGroup<IgnoredPragmas>;
def warn_pragma_expected_identifier : Warning<
- "expected identifier in '#pragma %0' - ignored">;
+ "expected identifier in '#pragma %0' - ignored">, InGroup<IgnoredPragmas>;
def warn_pragma_ms_struct : Warning<
- "incorrect use of '#pragma ms_struct on|off' - ignored">;
+ "incorrect use of '#pragma ms_struct on|off' - ignored">,
+ InGroup<IgnoredPragmas>;
def warn_pragma_extra_tokens_at_eol : Warning<
- "extra tokens at end of '#pragma %0' - ignored">;
+ "extra tokens at end of '#pragma %0' - ignored">,
+ InGroup<IgnoredPragmas>;
+def warn_pragma_expected_punc : Warning<
+ "expected ')' or ',' in '#pragma %0'">, InGroup<IgnoredPragmas>;
// - #pragma options
def warn_pragma_options_expected_align : Warning<
- "expected 'align' following '#pragma options' - ignored">;
+ "expected 'align' following '#pragma options' - ignored">,
+ InGroup<IgnoredPragmas>;
def warn_pragma_align_expected_equal : Warning<
- "expected '=' following '#pragma %select{align|options align}0' - ignored">;
+ "expected '=' following '#pragma %select{align|options align}0' - ignored">,
+ InGroup<IgnoredPragmas>;
def warn_pragma_align_invalid_option : Warning<
- "invalid alignment option in '#pragma %select{align|options align}0' - ignored">;
+ "invalid alignment option in '#pragma %select{align|options align}0' - ignored">,
+ InGroup<IgnoredPragmas>;
// - #pragma pack
def warn_pragma_pack_invalid_action : Warning<
- "unknown action for '#pragma pack' - ignored">;
+ "unknown action for '#pragma pack' - ignored">,
+ InGroup<IgnoredPragmas>;
def warn_pragma_pack_malformed : Warning<
- "expected integer or identifier in '#pragma pack' - ignored">;
+ "expected integer or identifier in '#pragma pack' - ignored">,
+ InGroup<IgnoredPragmas>;
// - #pragma unused
def warn_pragma_unused_expected_var : Warning<
- "expected '#pragma unused' argument to be a variable name">;
-def warn_pragma_unused_expected_punc : Warning<
- "expected ')' or ',' in '#pragma unused'">;
+ "expected '#pragma unused' argument to be a variable name">,
+ InGroup<IgnoredPragmas>;
// - #pragma fp_contract
def err_pragma_fp_contract_scope : Error<
"'#pragma fp_contract' can only appear at file scope or at the start of a "
// OpenCL EXTENSION pragma (OpenCL 1.1 [9.1])
def warn_pragma_expected_colon : Warning<
- "missing ':' after %0 - ignoring">;
+ "missing ':' after %0 - ignoring">, InGroup<IgnoredPragmas>;
def warn_pragma_expected_enable_disable : Warning<
- "expected 'enable' or 'disable' - ignoring">;
+ "expected 'enable' or 'disable' - ignoring">, InGroup<IgnoredPragmas>;
def warn_pragma_unknown_extension : Warning<
- "unknown OpenCL extension %0 - ignoring">;
+ "unknown OpenCL extension %0 - ignoring">, InGroup<IgnoredPragmas>;
def err_seh_expected_handler : Error<
"expected '__except' or '__finally' block">;
def err_omp_unexpected_directive : Error <
"unexpected OpenMP directive '#pragma omp %0'">;
def err_omp_expected_punc : Error <
- "expected ',' or ')' in %select{'#pragma omp %1'|'%1' clause}0">;
+ "expected ',' or ')' in '%0' clause">;
def err_omp_unexpected_clause : Error <
"unexpected OpenMP clause '%0' in directive '#pragma omp %1'">;
def err_omp_more_one_clause : Error <
"declaring function return value of type %0 is not allowed; did you forget * ?">;
def warn_enum_value_overflow : Warning<"overflow in enumeration value">;
def warn_pragma_options_align_reset_failed : Warning<
- "#pragma options align=reset failed: %0">;
+ "#pragma options align=reset failed: %0">,
+ InGroup<IgnoredPragmas>;
def err_pragma_options_align_mac68k_target_unsupported : Error<
"mac68k alignment pragma is not supported on this target">;
def warn_pragma_pack_invalid_alignment : Warning<
- "expected #pragma pack parameter to be '1', '2', '4', '8', or '16'">;
+ "expected #pragma pack parameter to be '1', '2', '4', '8', or '16'">,
+ InGroup<IgnoredPragmas>;
// Follow the MSVC implementation.
def warn_pragma_pack_show : Warning<"value of #pragma pack(show) == %0">;
def warn_pragma_pack_pop_identifer_and_alignment : Warning<
"specifying both a name and alignment to 'pop' is undefined">;
-def warn_pragma_pack_pop_failed : Warning<"#pragma pack(pop, ...) failed: %0">;
-def warn_pragma_ms_struct_failed : Warning<"#pramga ms_struct can not be used with dynamic classes or structures">, InGroup<IgnoredAttributes>;
+def warn_pragma_pack_pop_failed : Warning<"#pragma pack(pop, ...) failed: %0">,
+ InGroup<IgnoredPragmas>;
+def warn_pragma_ms_struct_failed : Warning<"#pramga ms_struct can not be used with dynamic classes or structures">,
+ InGroup<IgnoredPragmas>;
def warn_pragma_unused_undeclared_var : Warning<
- "undeclared variable %0 used as an argument for '#pragma unused'">;
+ "undeclared variable %0 used as an argument for '#pragma unused'">,
+ InGroup<IgnoredPragmas>;
def warn_pragma_unused_expected_var_arg : Warning<
- "only variables can be arguments to '#pragma unused'">;
+ "only variables can be arguments to '#pragma unused'">,
+ InGroup<IgnoredPragmas>;
def err_pragma_push_visibility_mismatch : Error<
"#pragma visibility push with no matching #pragma visibility pop">;
def note_surrounding_namespace_ends_here : Note<
} else if (Tok.isNot(tok::r_paren) &&
Tok.isNot(tok::annot_pragma_openmp_end)) {
Diag(Tok, diag::err_omp_expected_punc)
- << 1 << getOpenMPClauseName(Kind);
+ << getOpenMPClauseName(Kind);
}
}
}
// Illegal token!
- PP.Diag(Tok.getLocation(), diag::warn_pragma_unused_expected_punc);
+ PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_punc) << "unused";
return;
}
The list of warnings below should NEVER grow. It should gradually shrink to 0.
-CHECK: Warnings without flags (133):
+CHECK: Warnings without flags (111):
CHECK-NEXT: ext_delete_void_ptr_operand
CHECK-NEXT: ext_expected_semi_decl_list
CHECK-NEXT: ext_explicit_specialization_storage_class
CHECK-NEXT: warn_pp_convert_rhs_to_positive
CHECK-NEXT: warn_pp_expr_overflow
CHECK-NEXT: warn_pp_line_decimal
-CHECK-NEXT: warn_pragma_align_expected_equal
-CHECK-NEXT: warn_pragma_align_invalid_option
-CHECK-NEXT: warn_pragma_debug_unexpected_command
-CHECK-NEXT: warn_pragma_expected_colon
-CHECK-NEXT: warn_pragma_expected_enable_disable
-CHECK-NEXT: warn_pragma_expected_identifier
-CHECK-NEXT: warn_pragma_expected_lparen
-CHECK-NEXT: warn_pragma_expected_rparen
-CHECK-NEXT: warn_pragma_extra_tokens_at_eol
-CHECK-NEXT: warn_pragma_ms_struct
-CHECK-NEXT: warn_pragma_options_align_reset_failed
-CHECK-NEXT: warn_pragma_options_expected_align
-CHECK-NEXT: warn_pragma_pack_invalid_action
-CHECK-NEXT: warn_pragma_pack_invalid_alignment
-CHECK-NEXT: warn_pragma_pack_malformed
-CHECK-NEXT: warn_pragma_pack_pop_failed
CHECK-NEXT: warn_pragma_pack_pop_identifer_and_alignment
CHECK-NEXT: warn_pragma_pack_show
-CHECK-NEXT: warn_pragma_pop_macro_no_push
-CHECK-NEXT: warn_pragma_unknown_extension
-CHECK-NEXT: warn_pragma_unused_expected_punc
-CHECK-NEXT: warn_pragma_unused_expected_var
-CHECK-NEXT: warn_pragma_unused_expected_var_arg
-CHECK-NEXT: warn_pragma_unused_undeclared_var
CHECK-NEXT: warn_property_attr_mismatch
CHECK-NEXT: warn_property_attribute
CHECK-NEXT: warn_property_getter_owning_mismatch