1//==--- DiagnosticParseKinds.td - libparse diagnostics --------------------===// 2// 3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4// See https://llvm.org/LICENSE.txt for license information. 5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6// 7//===----------------------------------------------------------------------===// 8 9//===----------------------------------------------------------------------===// 10// Parser Diagnostics 11//===----------------------------------------------------------------------===// 12 13let Component = "Parse" in { 14 15def err_asm_qualifier_ignored : Error< 16 "expected 'volatile', 'inline', 'goto', or '('">, CatInlineAsm; 17def err_global_asm_qualifier_ignored : Error< 18 "meaningless '%0' on asm outside function">, CatInlineAsm; 19 20let CategoryName = "Inline Assembly Issue" in { 21def err_asm_empty : Error<"__asm used with no assembly instructions">; 22def err_inline_ms_asm_parsing : Error<"%0">; 23def err_msasm_unsupported_arch : Error< 24 "Unsupported architecture '%0' for MS-style inline assembly">; 25def err_msasm_unable_to_create_target : Error< 26 "MS-style inline assembly is not available: %0">; 27def err_gnu_inline_asm_disabled : Error< 28 "GNU-style inline assembly is disabled">; 29def err_asm_duplicate_qual : Error<"duplicate asm qualifier '%0'">; 30} 31 32let CategoryName = "Parse Issue" in { 33 34def ext_empty_translation_unit : Extension< 35 "ISO C requires a translation unit to contain at least one declaration">, 36 InGroup<DiagGroup<"empty-translation-unit">>; 37def warn_cxx98_compat_top_level_semi : Warning< 38 "extra ';' outside of a function is incompatible with C++98">, 39 InGroup<CXX98CompatExtraSemi>, DefaultIgnore; 40def ext_extra_semi : Extension< 41 "extra ';' %select{" 42 "outside of a function|" 43 "inside a %1|" 44 "inside instance variable list|" 45 "after member function definition}0">, 46 InGroup<ExtraSemi>; 47def ext_extra_semi_cxx11 : Extension< 48 "extra ';' outside of a function is a C++11 extension">, 49 InGroup<CXX11ExtraSemi>; 50def warn_extra_semi_after_mem_fn_def : Warning< 51 "extra ';' after member function definition">, 52 InGroup<ExtraSemi>, DefaultIgnore; 53def warn_null_statement : Warning< 54 "empty expression statement has no effect; " 55 "remove unnecessary ';' to silence this warning">, 56 InGroup<ExtraSemiStmt>, DefaultIgnore; 57 58def warn_misleading_indentation : Warning< 59 "misleading indentation; statement is not part of " 60 "the previous '%select{if|else|for|while}0'">, 61 InGroup<MisleadingIndentation>, DefaultIgnore; 62def note_previous_statement : Note< 63 "previous statement is here">; 64 65def ext_thread_before : Extension<"'__thread' before '%0'">; 66def ext_keyword_as_ident : ExtWarn< 67 "keyword '%0' will be made available as an identifier " 68 "%select{here|for the remainder of the translation unit}1">, 69 InGroup<KeywordCompat>; 70 71def ext_nullability : Extension< 72 "type nullability specifier %0 is a Clang extension">, 73 InGroup<DiagGroup<"nullability-extension">>; 74 75def err_empty_enum : Error<"use of empty enum">; 76 77def ext_ident_list_in_param : Extension< 78 "type-less parameter names in function declaration">; 79def ext_c99_variable_decl_in_for_loop : Extension< 80 "variable declaration in for loop is a C99-specific feature">, InGroup<C99>; 81def ext_c99_compound_literal : Extension< 82 "compound literals are a C99-specific feature">, InGroup<C99>; 83def ext_enumerator_list_comma_c : Extension< 84 "commas at the end of enumerator lists are a C99-specific " 85 "feature">, InGroup<C99>; 86def ext_enumerator_list_comma_cxx : Extension< 87 "commas at the end of enumerator lists are a C++11 extension">, 88 InGroup<CXX11>; 89def warn_cxx98_compat_enumerator_list_comma : Warning< 90 "commas at the end of enumerator lists are incompatible with C++98">, 91 InGroup<CXX98CompatPedantic>, DefaultIgnore; 92def err_enumerator_list_missing_comma : Error< 93 "missing ',' between enumerators">; 94def err_enumerator_unnamed_no_def : Error< 95 "unnamed enumeration must be a definition">; 96def ext_cxx11_enum_fixed_underlying_type : Extension< 97 "enumeration types with a fixed underlying type are a C++11 extension">, 98 InGroup<CXX11>; 99def ext_ms_c_enum_fixed_underlying_type : Extension< 100 "enumeration types with a fixed underlying type are a Microsoft extension">, 101 InGroup<MicrosoftFixedEnum>; 102def ext_clang_c_enum_fixed_underlying_type : Extension< 103 "enumeration types with a fixed underlying type are a Clang extension">, 104 InGroup<DiagGroup<"fixed-enum-extension">>; 105def warn_cxx98_compat_enum_fixed_underlying_type : Warning< 106 "enumeration types with a fixed underlying type are incompatible with C++98">, 107 InGroup<CXX98Compat>, DefaultIgnore; 108def ext_enum_base_in_type_specifier : ExtWarn< 109 "non-defining declaration of enumeration with a fixed underlying type is " 110 "only permitted as a standalone declaration" 111 "%select{|; missing list of enumerators?}0">, 112 InGroup<DiagGroup<"elaborated-enum-base">>, DefaultError; 113def ext_elaborated_enum_class : ExtWarn< 114 "reference to enumeration must use 'enum' not 'enum %select{struct|class}0'">, 115 InGroup<DiagGroup<"elaborated-enum-class">>, DefaultError; 116def err_scoped_enum_missing_identifier : Error< 117 "scoped enumeration requires a name">; 118def ext_scoped_enum : ExtWarn< 119 "scoped enumerations are a C++11 extension">, InGroup<CXX11>; 120def warn_cxx98_compat_scoped_enum : Warning< 121 "scoped enumerations are incompatible with C++98">, 122 InGroup<CXX98Compat>, DefaultIgnore; 123def err_anonymous_enum_bitfield : Error< 124 "ISO C++ only allows ':' in member enumeration declaration to introduce " 125 "a fixed underlying type, not an anonymous bit-field">; 126 127def warn_cxx98_compat_alignof : Warning< 128 "alignof expressions are incompatible with C++98">, 129 InGroup<CXX98Compat>, DefaultIgnore; 130def ext_alignof_expr : ExtWarn< 131 "%0 applied to an expression is a GNU extension">, InGroup<GNUAlignofExpression>; 132def err_lambda_after_delete : Error< 133 "'[]' after delete interpreted as 'delete[]'; add parentheses to treat this as a lambda-expression">; 134 135def warn_microsoft_dependent_exists : Warning< 136 "dependent %select{__if_not_exists|__if_exists}0 declarations are ignored">, 137 InGroup<DiagGroup<"microsoft-exists">>; 138def warn_microsoft_qualifiers_ignored : Warning< 139 "qualifiers after comma in declarator list are ignored">, 140 InGroup<IgnoredAttributes>; 141 142def err_duplicate_default_assoc : Error< 143 "duplicate default generic association">; 144def note_previous_default_assoc : Note< 145 "previous default generic association is here">; 146 147def ext_c99_feature : Extension< 148 "'%0' is a C99 extension">, InGroup<C99>; 149def ext_c11_feature : Extension< 150 "'%0' is a C11 extension">, InGroup<C11>; 151 152def err_c11_noreturn_misplaced : Error< 153 "'_Noreturn' keyword must precede function declarator">; 154 155def ext_gnu_indirect_goto : Extension< 156 "use of GNU indirect-goto extension">, InGroup<GNULabelsAsValue>; 157def ext_gnu_address_of_label : Extension< 158 "use of GNU address-of-label extension">, InGroup<GNULabelsAsValue>; 159def err_stmtexpr_file_scope : Error< 160 "statement expression not allowed at file scope">; 161def ext_gnu_statement_expr : Extension< 162 "use of GNU statement expression extension">, InGroup<GNUStatementExpression>; 163def ext_gnu_conditional_expr : Extension< 164 "use of GNU ?: conditional expression extension, omitting middle operand">, InGroup<GNUConditionalOmittedOperand>; 165def ext_gnu_empty_initializer : Extension< 166 "use of GNU empty initializer extension">, InGroup<GNUEmptyInitializer>; 167def ext_gnu_array_range : Extension<"use of GNU array range extension">, 168 InGroup<GNUDesignator>; 169def ext_gnu_missing_equal_designator : ExtWarn< 170 "use of GNU 'missing =' extension in designator">, 171 InGroup<GNUDesignator>; 172def err_expected_equal_designator : Error<"expected '=' or another designator">; 173def ext_gnu_old_style_field_designator : ExtWarn< 174 "use of GNU old-style field designator extension">, 175 InGroup<GNUDesignator>; 176def ext_gnu_case_range : Extension<"use of GNU case range extension">, 177 InGroup<GNUCaseRange>; 178 179// Generic errors. 180def err_expected_expression : Error<"expected expression">; 181def err_expected_type : Error<"expected a type">; 182def err_expected_external_declaration : Error<"expected external declaration">; 183def err_extraneous_closing_brace : Error<"extraneous closing brace ('}')">; 184def err_expected_semi_declaration : Error< 185 "expected ';' at end of declaration">; 186def err_expected_semi_decl_list : Error< 187 "expected ';' at end of declaration list">; 188def ext_expected_semi_decl_list : ExtWarn< 189 "expected ';' at end of declaration list">; 190def err_expected_member_name_or_semi : Error< 191 "expected member name or ';' after declaration specifiers">; 192def err_function_declared_typedef : Error< 193 "function definition declared 'typedef'">; 194def err_at_defs_cxx : Error<"@defs is not supported in Objective-C++">; 195def err_at_in_class : Error<"unexpected '@' in member specification">; 196def err_unexpected_semi : Error<"unexpected ';' before %0">; 197def err_postfix_after_unary_requires_parens : Error< 198 "expression cannot be followed by a postfix %0 operator; add parentheses">; 199def err_unparenthesized_non_primary_expr_in_requires_clause : Error< 200 "parentheses are required around this expression in a requires clause">; 201def note_unparenthesized_non_primary_expr_in_requires_clause : Note< 202 "parentheses are required around this expression in a requires clause">; 203 204def err_expected_fn_body : Error< 205 "expected function body after function declarator">; 206def warn_attribute_on_function_definition : Warning< 207 "GCC does not allow %0 attribute in this position on a function definition">, 208 InGroup<GccCompat>; 209def warn_gcc_attribute_location : Warning< 210 "GCC does not allow an attribute in this position on a function declaration">, 211 InGroup<GccCompat>; 212def warn_gcc_variable_decl_in_for_loop : Warning< 213 "GCC does not allow variable declarations in for loop initializers before " 214 "C99">, InGroup<GccCompat>; 215def warn_attribute_no_decl : Warning< 216 "attribute %0 ignored, because it is not attached to a declaration">, 217 InGroup<IgnoredAttributes>; 218def err_ms_attributes_not_enabled : Error< 219 "'__declspec' attributes are not enabled; use '-fdeclspec' or " 220 "'-fms-extensions' to enable support for __declspec attributes">; 221def err_expected_method_body : Error<"expected method body">; 222def err_declspec_after_virtspec : Error< 223 "'%0' qualifier may not appear after the virtual specifier '%1'">; 224def err_invalid_token_after_toplevel_declarator : Error< 225 "expected ';' after top level declarator">; 226def err_invalid_token_after_declarator_suggest_equal : Error< 227 "invalid %0 at end of declaration; did you mean '='?">; 228def err_expected_statement : Error<"expected statement">; 229def err_expected_lparen_after : Error<"expected '(' after '%0'">; 230def err_expected_rparen_after : Error<"expected ')' after '%0'">; 231def err_expected_punc : Error<"expected ')' or ',' after '%0'">; 232def err_expected_less_after : Error<"expected '<' after '%0'">; 233def err_expected_lbrace_in_compound_literal : Error< 234 "expected '{' in compound literal">; 235def err_expected_while : Error<"expected 'while' in do/while loop">; 236 237def err_expected_semi_after_stmt : Error<"expected ';' after %0 statement">; 238def err_expected_semi_after_expr : Error<"expected ';' after expression">; 239def err_extraneous_token_before_semi : Error<"extraneous '%0' before ';'">; 240 241def err_expected_semi_after_method_proto : Error< 242 "expected ';' after method prototype">; 243def err_expected_semi_after_namespace_name : Error< 244 "expected ';' after namespace name">; 245def err_unexpected_namespace_attributes_alias : Error< 246 "attributes cannot be specified on namespace alias">; 247def err_unexpected_nested_namespace_attribute : Error< 248 "attributes cannot be specified on a nested namespace definition">; 249def err_inline_namespace_alias : Error<"namespace alias cannot be inline">; 250def err_namespace_nonnamespace_scope : Error< 251 "namespaces can only be defined in global or namespace scope">; 252def ext_nested_namespace_definition : ExtWarn< 253 "nested namespace definition is a C++17 extension; " 254 "define each namespace separately">, InGroup<CXX17>; 255def warn_cxx14_compat_nested_namespace_definition : Warning< 256 "nested namespace definition is incompatible with C++ standards before C++17">, 257 InGroup<CXXPre17Compat>, DefaultIgnore; 258def ext_inline_nested_namespace_definition : ExtWarn< 259 "inline nested namespace definition is a C++20 extension">, InGroup<CXX20>; 260def warn_cxx17_compat_inline_nested_namespace_definition : Warning< 261 "inline nested namespace definition is incompatible with C++ standards before" 262 " C++20">, InGroup<CXXPre20Compat>, DefaultIgnore; 263def err_inline_nested_namespace_definition : Error< 264 "nested namespace definition cannot be 'inline'">; 265def err_expected_semi_after_attribute_list : Error< 266 "expected ';' after attribute list">; 267def err_expected_semi_after_static_assert : Error< 268 "expected ';' after static_assert">; 269def err_expected_semi_for : Error<"expected ';' in 'for' statement specifier">; 270def err_single_decl_assign_in_for_range : Error< 271 "range-based 'for' statement uses ':', not '='">; 272def warn_missing_selector_name : Warning< 273 "%0 used as the name of the previous parameter rather than as part " 274 "of the selector">, 275 InGroup<DiagGroup<"missing-selector-name">>; 276def note_missing_selector_name : Note< 277 "introduce a parameter name to make %0 part of the selector">; 278def note_force_empty_selector_name : Note< 279 "or insert whitespace before ':' to use %0 as parameter name " 280 "and have an empty entry in the selector">; 281def err_label_end_of_compound_statement : Error< 282 "label at end of compound statement: expected statement">; 283def err_address_of_label_outside_fn : Error< 284 "use of address-of-label extension outside of a function body">; 285def err_asm_operand_wide_string_literal : Error< 286 "cannot use %select{unicode|wide|an empty}0 string literal in 'asm'">; 287def err_expected_selector_for_method : Error< 288 "expected selector for Objective-C method">; 289def err_expected_property_name : Error<"expected property name">; 290 291def warn_cheri_capability_attribute_location : Warning< 292 "use of __capability before the pointer type is deprecated">, 293 InGroup<DeprecatedDeclarations>; 294 295def err_unexpected_at : Error<"unexpected '@' in program">; 296def err_atimport : Error< 297"use of '@import' when modules are disabled">; 298 299def warn_atimport_in_framework_header : Warning< 300 "use of '@import' in framework header is discouraged, " 301 "including this header requires -fmodules">, 302 InGroup<FrameworkHdrAtImport>; 303 304def err_invalid_reference_qualifier_application : Error< 305 "'%0' qualifier may not be applied to a reference">; 306def err_illegal_decl_reference_to_reference : Error< 307 "%0 declared as a reference to a reference">; 308def ext_rvalue_reference : ExtWarn< 309 "rvalue references are a C++11 extension">, InGroup<CXX11>; 310def warn_cxx98_compat_rvalue_reference : Warning< 311 "rvalue references are incompatible with C++98">, 312 InGroup<CXX98Compat>, DefaultIgnore; 313def ext_ref_qualifier : ExtWarn< 314 "reference qualifiers on functions are a C++11 extension">, InGroup<CXX11>; 315def warn_cxx98_compat_ref_qualifier : Warning< 316 "reference qualifiers on functions are incompatible with C++98">, 317 InGroup<CXX98Compat>, DefaultIgnore; 318def ext_inline_namespace : ExtWarn< 319 "inline namespaces are a C++11 feature">, InGroup<CXX11InlineNamespace>; 320def warn_cxx98_compat_inline_namespace : Warning< 321 "inline namespaces are incompatible with C++98">, 322 InGroup<CXX98Compat>, DefaultIgnore; 323def ext_generalized_initializer_lists : ExtWarn< 324 "generalized initializer lists are a C++11 extension">, 325 InGroup<CXX11>; 326def warn_cxx98_compat_generalized_initializer_lists : Warning< 327 "generalized initializer lists are incompatible with C++98">, 328 InGroup<CXX98Compat>, DefaultIgnore; 329def err_init_list_bin_op : Error<"initializer list cannot be used on the " 330 "%select{left|right}0 hand side of operator '%1'">; 331def warn_cxx98_compat_trailing_return_type : Warning< 332 "trailing return types are incompatible with C++98">, 333 InGroup<CXX98Compat>, DefaultIgnore; 334def err_requires_clause_must_appear_after_trailing_return : Error< 335 "trailing return type must appear before trailing requires clause">; 336def err_requires_clause_on_declarator_not_declaring_a_function : Error< 337 "trailing requires clause can only be used when declaring a function">; 338def err_requires_clause_inside_parens : Error< 339 "trailing requires clause should be placed outside parentheses">; 340def ext_auto_storage_class : ExtWarn< 341 "'auto' storage class specifier is not permitted in C++11, and will not " 342 "be supported in future releases">, InGroup<DiagGroup<"auto-storage-class">>; 343def ext_decltype_auto_type_specifier : ExtWarn< 344 "'decltype(auto)' type specifier is a C++14 extension">, InGroup<CXX14>; 345def warn_cxx11_compat_decltype_auto_type_specifier : Warning< 346 "'decltype(auto)' type specifier is incompatible with C++ standards before " 347 "C++14">, InGroup<CXXPre14Compat>, DefaultIgnore; 348def ext_auto_type : Extension< 349 "'__auto_type' is a GNU extension">, 350 InGroup<GNUAutoType>; 351def ext_for_range : ExtWarn< 352 "range-based for loop is a C++11 extension">, InGroup<CXX11>; 353def warn_cxx98_compat_for_range : Warning< 354 "range-based for loop is incompatible with C++98">, 355 InGroup<CXX98Compat>, DefaultIgnore; 356def err_for_range_identifier : Error< 357 "range-based for loop requires type for loop variable">; 358def err_for_range_expected_decl : Error< 359 "for range declaration must declare a variable">; 360def err_argument_required_after_attribute : Error< 361 "argument required after attribute">; 362def err_missing_param : Error<"expected parameter declarator">; 363def err_function_scope_depth_exceeded : Error< 364 "function scope depth exceeded maximum of %0">, DefaultFatal; 365def err_missing_comma_before_ellipsis : Error< 366 "C requires a comma prior to the ellipsis in a variadic function type">; 367def err_unexpected_typedef_ident : Error< 368 "unexpected type name %0: expected identifier">; 369def warn_cxx98_compat_decltype : Warning< 370 "'decltype' type specifier is incompatible with C++98">, 371 InGroup<CXX98Compat>, DefaultIgnore; 372def err_unexpected_scope_on_base_decltype : Error< 373 "unexpected namespace scope prior to decltype">; 374def err_expected_class_name : Error<"expected class name">; 375def err_expected_class_name_not_template : 376 Error<"'typename' is redundant; base classes are implicitly types">; 377def err_unspecified_vla_size_with_static : Error< 378 "'static' may not be used with an unspecified variable length array size">; 379def err_unspecified_size_with_static : Error< 380 "'static' may not be used without an array size">; 381def err_expected_parentheses_around_typename : Error< 382 "expected parentheses around type name in %0 expression">; 383 384def err_expected_case_before_expression: Error< 385 "expected 'case' keyword before expression">; 386 387def ext_warn_gnu_final : ExtWarn< 388 "__final is a GNU extension, consider using C++11 final">, 389 InGroup<GccCompat>; 390 391// Declarations. 392def err_typename_requires_specqual : Error< 393 "type name requires a specifier or qualifier">; 394def err_typename_invalid_storageclass : Error< 395 "type name does not allow storage class to be specified">; 396def err_typename_invalid_functionspec : Error< 397 "type name does not allow function specifier to be specified">; 398def err_typename_invalid_constexpr : Error< 399 "type name does not allow %sub{select_constexpr_spec_kind}0 specifier " 400 "to be specified">; 401def err_typename_identifiers_only : Error< 402 "typename is allowed for identifiers only">; 403 404def err_friend_invalid_in_context : Error< 405 "'friend' used outside of class">; 406def err_templated_using_directive_declaration : Error< 407 "cannot template a using %select{directive|declaration}0">; 408def err_unexpected_colon_in_nested_name_spec : Error< 409 "unexpected ':' in nested name specifier; did you mean '::'?">; 410def err_unexpected_token_in_nested_name_spec : Error< 411 "'%0' cannot be a part of nested name specifier; did you mean ':'?">; 412def err_bool_redeclaration : Error< 413 "redeclaration of C++ built-in type 'bool'">; 414def warn_cxx98_compat_static_assert : Warning< 415 "static_assert declarations are incompatible with C++98">, 416 InGroup<CXX98Compat>, DefaultIgnore; 417def ext_static_assert_no_message : ExtWarn< 418 "static_assert with no message is a C++17 extension">, InGroup<CXX17>; 419def warn_cxx14_compat_static_assert_no_message : Warning< 420 "static_assert with no message is incompatible with C++ standards before " 421 "C++17">, 422 DefaultIgnore, InGroup<CXXPre17Compat>; 423def err_function_definition_not_allowed : Error< 424 "function definition is not allowed here">; 425def err_expected_end_of_enumerator : Error< 426 "expected '= constant-expression' or end of enumerator definition">; 427def err_expected_coloncolon_after_super : Error< 428 "expected '::' after '__super'">; 429 430def ext_decomp_decl_empty : ExtWarn< 431 "ISO C++17 does not allow a decomposition group to be empty">, 432 InGroup<DiagGroup<"empty-decomposition">>; 433 434/// Objective-C parser diagnostics 435def err_expected_minus_or_plus : Error< 436 "method type specifier must start with '-' or '+'">; 437def err_objc_missing_end : Error<"missing '@end'">; 438def note_objc_container_start : Note< 439 "%select{class|protocol|category|class extension|implementation" 440 "|category implementation}0 started here">; 441def warn_objc_protocol_qualifier_missing_id : Warning< 442 "protocol has no object type specified; defaults to qualified 'id'">; 443def err_objc_unknown_at : Error<"expected an Objective-C directive after '@'">; 444def err_illegal_super_cast : Error< 445 "cannot cast 'super' (it isn't an expression)">; 446def err_nsnumber_nonliteral_unary : Error< 447 "@%0 must be followed by a number to form an NSNumber object">; 448def warn_cstyle_param : Warning< 449 "use of C-style parameters in Objective-C method declarations" 450 " is deprecated">, InGroup<DeprecatedDeclarations>; 451 452let CategoryName = "ARC Parse Issue" in { 453def err_arc_bridge_retain : Error< 454 "unknown cast annotation __bridge_retain; did you mean __bridge_retained?">; 455// To be default mapped to an error later. 456def warn_arc_bridge_cast_nonarc : Warning< 457 "'%0' casts have no effect when not using ARC">, 458 InGroup<DiagGroup<"arc-bridge-casts-disallowed-in-nonarc">>; 459} 460 461def err_objc_illegal_visibility_spec : Error< 462 "illegal visibility specification">; 463def err_objc_illegal_interface_qual : Error<"illegal interface qualifier">; 464def err_objc_expected_equal_for_getter : Error< 465 "expected '=' for Objective-C getter">; 466def err_objc_expected_equal_for_setter : Error< 467 "expected '=' for Objective-C setter">; 468def err_objc_expected_selector_for_getter_setter : Error< 469 "expected selector for Objective-C %select{setter|getter}0">; 470def err_objc_property_requires_field_name : Error< 471 "property requires fields to be named">; 472def err_objc_property_bitfield : Error<"property name cannot be a bit-field">; 473def err_objc_expected_property_attr : Error<"unknown property attribute %0">; 474def err_objc_unexpected_attr : Error< 475 "prefix attribute must be followed by an interface, protocol, or implementation">; 476def err_objc_postfix_attribute : Error < 477 "postfix attributes are not allowed on Objective-C directives">; 478def err_objc_postfix_attribute_hint : Error < 479 "postfix attributes are not allowed on Objective-C directives, place" 480 " them in front of '%select{@interface|@protocol}0'">; 481def err_objc_directive_only_in_protocol : Error< 482 "directive may only be specified in protocols only">; 483def err_missing_catch_finally : Error< 484 "@try statement without a @catch and @finally clause">; 485def err_objc_concat_string : Error<"unexpected token after Objective-C string">; 486def err_expected_objc_container : Error< 487 "'@end' must appear in an Objective-C context">; 488def err_unexpected_protocol_qualifier : Error< 489 "@implementation declaration cannot be protocol qualified">; 490def err_objc_unexpected_atend : Error< 491 "'@end' appears where closing brace '}' is expected">; 492def err_synthesized_property_name : Error< 493 "expected a property name in @synthesize">; 494def warn_semicolon_before_method_body : Warning< 495 "semicolon before method body is ignored">, 496 InGroup<SemiBeforeMethodBody>, DefaultIgnore; 497def note_extra_comma_message_arg : Note< 498 "comma separating Objective-C messaging arguments">; 499 500def err_expected_field_designator : Error< 501 "expected a field designator, such as '.field = 4'">; 502 503def err_declaration_does_not_declare_param : Error< 504 "declaration does not declare a parameter">; 505def err_no_matching_param : Error<"parameter named %0 is missing">; 506 507/// Objective-C++ parser diagnostics 508def err_expected_token_instead_of_objcxx_keyword : Error< 509 "expected %0; %1 is a keyword in Objective-C++">; 510def err_expected_member_name_or_semi_objcxx_keyword : Error< 511 "expected member name or ';' after declaration specifiers; " 512 "%0 is a keyword in Objective-C++">; 513 514/// C++ parser diagnostics 515def err_invalid_operator_on_type : Error< 516 "cannot use %select{dot|arrow}0 operator on a type">; 517def err_expected_unqualified_id : Error< 518 "expected %select{identifier|unqualified-id}0">; 519def err_brackets_go_after_unqualified_id : Error< 520 "brackets are not allowed here; to declare an array, " 521 "place the brackets after the %select{identifier|name}0">; 522def err_unexpected_unqualified_id : Error<"type-id cannot have a name">; 523def err_func_def_no_params : Error< 524 "function definition does not declare parameters">; 525def err_expected_lparen_after_type : Error< 526 "expected '(' for function-style cast or type construction">; 527def err_expected_init_in_condition : Error< 528 "variable declaration in condition must have an initializer">; 529def err_expected_init_in_condition_lparen : Error< 530 "variable declaration in condition cannot have a parenthesized initializer">; 531def err_extraneous_rparen_in_condition : Error< 532 "extraneous ')' after condition, expected a statement">; 533def warn_dangling_else : Warning< 534 "add explicit braces to avoid dangling else">, 535 InGroup<DanglingElse>; 536def err_expected_member_or_base_name : Error< 537 "expected class member or base class name">; 538def err_expected_lbrace_after_base_specifiers : Error< 539 "expected '{' after base class list">; 540def err_missing_end_of_definition : Error< 541 "missing '}' at end of definition of %q0">; 542def note_missing_end_of_definition_before : Note< 543 "still within definition of %q0 here">; 544def ext_ellipsis_exception_spec : Extension< 545 "exception specification of '...' is a Microsoft extension">, 546 InGroup<MicrosoftExceptionSpec>; 547def err_dynamic_and_noexcept_specification : Error< 548 "cannot have both throw() and noexcept() clause on the same function">; 549def err_except_spec_unparsed : Error< 550 "unexpected end of exception specification">; 551def ext_dynamic_exception_spec : ExtWarn< 552 "ISO C++17 does not allow dynamic exception specifications">, 553 InGroup<DynamicExceptionSpec>, DefaultError; 554def warn_exception_spec_deprecated : Warning< 555 "dynamic exception specifications are deprecated">, 556 InGroup<DeprecatedDynamicExceptionSpec>, DefaultIgnore; 557def note_exception_spec_deprecated : Note<"use '%0' instead">; 558def warn_cxx98_compat_noexcept_decl : Warning< 559 "noexcept specifications are incompatible with C++98">, 560 InGroup<CXX98Compat>, DefaultIgnore; 561def err_expected_catch : Error<"expected catch">; 562def err_using_namespace_in_class : Error< 563 "'using namespace' is not allowed in classes">; 564def err_constructor_bad_name : Error< 565 "missing return type for function %0; did you mean the constructor name %1?">; 566def err_destructor_tilde_identifier : Error< 567 "expected a class name after '~' to name a destructor">; 568def err_destructor_tilde_scope : Error< 569 "'~' in destructor name should be after nested name specifier">; 570def err_destructor_template_id : Error< 571 "destructor name %0 does not refer to a template">; 572def err_default_arg_unparsed : Error< 573 "unexpected end of default argument expression">; 574def err_bracket_depth_exceeded : Error< 575 "bracket nesting level exceeded maximum of %0">, DefaultFatal; 576def note_bracket_depth : Note< 577 "use -fbracket-depth=N to increase maximum nesting level">; 578def err_misplaced_ellipsis_in_declaration : Error< 579 "'...' must %select{immediately precede declared identifier|" 580 "be innermost component of anonymous pack declaration}0">; 581def warn_misplaced_ellipsis_vararg : Warning< 582 "'...' in this location creates a C-style varargs function" 583 "%select{, not a function parameter pack|}0">, 584 InGroup<DiagGroup<"ambiguous-ellipsis">>; 585def note_misplaced_ellipsis_vararg_existing_ellipsis : Note< 586 "preceding '...' declares a function parameter pack">; 587def note_misplaced_ellipsis_vararg_add_ellipsis : Note< 588 "place '...' %select{immediately before declared identifier|here}0 " 589 "to declare a function parameter pack">; 590def note_misplaced_ellipsis_vararg_add_comma : Note< 591 "insert ',' before '...' to silence this warning">; 592def ext_abstract_pack_declarator_parens : ExtWarn< 593 "ISO C++11 requires a parenthesized pack declaration to have a name">, 594 InGroup<DiagGroup<"anonymous-pack-parens">>; 595def err_function_is_not_record : Error< 596 "unexpected %0 in function call; perhaps remove the %0?">; 597def err_super_in_using_declaration : Error< 598 "'__super' cannot be used with a using declaration">; 599def ext_constexpr_if : ExtWarn< 600 "constexpr if is a C++17 extension">, InGroup<CXX17>; 601def warn_cxx14_compat_constexpr_if : Warning< 602 "constexpr if is incompatible with C++ standards before C++17">, 603 DefaultIgnore, InGroup<CXXPre17Compat>; 604def ext_init_statement : ExtWarn< 605 "'%select{if|switch}0' initialization statements are a C++17 extension">, 606 InGroup<CXX17>; 607def warn_cxx14_compat_init_statement : Warning< 608 "%select{if|switch}0 initialization statements are incompatible with " 609 "C++ standards before C++17">, DefaultIgnore, InGroup<CXXPre17Compat>; 610def ext_for_range_init_stmt : ExtWarn< 611 "range-based for loop initialization statements are a C++20 extension">, 612 InGroup<CXX20>; 613def warn_cxx17_compat_for_range_init_stmt : Warning< 614 "range-based for loop initialization statements are incompatible with " 615 "C++ standards before C++20">, DefaultIgnore, InGroup<CXXPre20Compat>; 616def warn_empty_init_statement : Warning< 617 "empty initialization statement of '%select{if|switch|range-based for}0' " 618 "has no effect">, InGroup<EmptyInitStatement>, DefaultIgnore; 619def err_keyword_as_parameter : Error < 620 "invalid parameter name: '%0' is a keyword">; 621 622// C++ derived classes 623def err_dup_virtual : Error<"duplicate 'virtual' in base specifier">; 624 625// C++ operator overloading 626def err_literal_operator_string_prefix : Error< 627 "string literal after 'operator' cannot have an encoding prefix">; 628def err_literal_operator_string_not_empty : Error< 629 "string literal after 'operator' must be '\"\"'">; 630def warn_cxx98_compat_literal_operator : Warning< 631 "literal operators are incompatible with C++98">, 632 InGroup<CXX98Compat>, DefaultIgnore; 633 634// Classes. 635def err_anon_type_definition : Error< 636 "declaration of anonymous %0 must be a definition">; 637def err_default_delete_in_multiple_declaration : Error< 638 "'= %select{default|delete}0' is a function definition and must occur in a " 639 "standalone declaration">; 640 641def warn_cxx98_compat_noexcept_expr : Warning< 642 "noexcept expressions are incompatible with C++98">, 643 InGroup<CXX98Compat>, DefaultIgnore; 644def warn_cxx98_compat_nullptr : Warning< 645 "'nullptr' is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore; 646 647def warn_wrong_clang_attr_namespace : Warning< 648 "'__clang__' is a predefined macro name, not an attribute scope specifier; " 649 "did you mean '_Clang' instead?">, InGroup<IgnoredAttributes>; 650def ext_ns_enum_attribute : Extension< 651 "attributes on %select{a namespace|an enumerator}0 declaration are " 652 "a C++17 extension">, InGroup<CXX17>; 653def warn_cxx14_compat_ns_enum_attribute : Warning< 654 "attributes on %select{a namespace|an enumerator}0 declaration are " 655 "incompatible with C++ standards before C++17">, 656 InGroup<CXXPre17CompatPedantic>, DefaultIgnore; 657def warn_cxx98_compat_alignas : Warning<"'alignas' is incompatible with C++98">, 658 InGroup<CXX98Compat>, DefaultIgnore; 659def warn_cxx98_compat_attribute : Warning< 660 "C++11 attribute syntax is incompatible with C++98">, 661 InGroup<CXX98Compat>, DefaultIgnore; 662def err_cxx11_attribute_forbids_arguments : Error< 663 "attribute %0 cannot have an argument list">; 664def err_attribute_requires_arguments : Error< 665 "parentheses must be omitted if %0 attribute's argument list is empty">; 666def err_cxx11_attribute_forbids_ellipsis : Error< 667 "attribute %0 cannot be used as an attribute pack">; 668def err_cxx11_attribute_repeated : Error< 669 "attribute %0 cannot appear multiple times in an attribute specifier">; 670def warn_cxx14_compat_using_attribute_ns : Warning< 671 "default scope specifier for attributes is incompatible with C++ standards " 672 "before C++17">, InGroup<CXXPre17Compat>, DefaultIgnore; 673def ext_using_attribute_ns : ExtWarn< 674 "default scope specifier for attributes is a C++17 extension">, 675 InGroup<CXX17>; 676def err_using_attribute_ns_conflict : Error< 677 "attribute with scope specifier cannot follow default scope specifier">; 678def err_attributes_not_allowed : Error<"an attribute list cannot appear here">; 679def err_attributes_misplaced : Error<"misplaced attributes; expected attributes here">; 680def err_l_square_l_square_not_attribute : Error< 681 "C++11 only allows consecutive left square brackets when " 682 "introducing an attribute">; 683def err_ms_declspec_type : Error< 684 "__declspec attributes must be an identifier or string literal">; 685def err_ms_property_no_getter_or_putter : Error< 686 "property does not specify a getter or a putter">; 687def err_ms_property_unknown_accessor : Error< 688 "expected 'get' or 'put' in property declaration">; 689def err_ms_property_has_set_accessor : Error< 690 "putter for property must be specified as 'put', not 'set'">; 691def err_ms_property_missing_accessor_kind : Error< 692 "missing 'get=' or 'put='">; 693def err_ms_property_expected_equal : Error< 694 "expected '=' after '%0'">; 695def err_ms_property_duplicate_accessor : Error< 696 "property declaration specifies '%0' accessor twice">; 697def err_ms_property_expected_accessor_name : Error< 698 "expected name of accessor method">; 699def err_ms_property_expected_comma_or_rparen : Error< 700 "expected ',' or ')' at end of property accessor list">; 701def err_ms_property_initializer : Error< 702 "property declaration cannot have an in-class initializer">; 703 704def warn_cxx20_compat_explicit_bool : Warning< 705 "this expression will be parsed as explicit(bool) in C++20">, 706 InGroup<CXX20Compat>, DefaultIgnore; 707def warn_cxx17_compat_explicit_bool : Warning< 708 "explicit(bool) is incompatible with C++ standards before C++20">, 709 InGroup<CXXPre20Compat>, DefaultIgnore; 710def ext_explicit_bool : ExtWarn<"explicit(bool) is a C++20 extension">, 711 InGroup<CXX20>; 712 713/// C++ Templates 714def err_expected_template : Error<"expected template">; 715def err_unknown_template_name : Error< 716 "unknown template name %0">; 717def err_expected_comma_greater : Error< 718 "expected ',' or '>' in template-parameter-list">; 719def err_class_on_template_template_param : Error< 720 "template template parameter requires 'class' after the parameter list">; 721def ext_template_template_param_typename : ExtWarn< 722 "template template parameter using 'typename' is a C++17 extension">, 723 InGroup<CXX17>; 724def warn_cxx14_compat_template_template_param_typename : Warning< 725 "template template parameter using 'typename' is " 726 "incompatible with C++ standards before C++17">, 727 InGroup<CXXPre17Compat>, DefaultIgnore; 728def err_template_spec_syntax_non_template : Error< 729 "identifier followed by '<' indicates a class template specialization but " 730 "%0 %select{does not refer to a template|refers to a function template|" 731 "<unused>|refers to a variable template|<unused>|refers to a concept}1">; 732def err_id_after_template_in_nested_name_spec : Error< 733 "expected template name after 'template' keyword in nested name specifier">; 734def err_unexpected_template_in_unqualified_id : Error< 735 "'template' keyword not permitted here">; 736def err_unexpected_template_in_destructor_name : Error< 737 "'template' keyword not permitted in destructor name">; 738def err_unexpected_template_after_using : Error< 739 "'template' keyword not permitted after 'using' keyword">; 740def err_two_right_angle_brackets_need_space : Error< 741 "a space is required between consecutive right angle brackets (use '> >')">; 742def err_right_angle_bracket_equal_needs_space : Error< 743 "a space is required between a right angle bracket and an equals sign " 744 "(use '> =')">; 745def warn_cxx11_right_shift_in_template_arg : Warning< 746 "use of right-shift operator ('>>') in template argument will require " 747 "parentheses in C++11">, InGroup<CXX11Compat>; 748def warn_cxx98_compat_two_right_angle_brackets : Warning< 749 "consecutive right angle brackets are incompatible with C++98 (use '> >')">, 750 InGroup<CXX98Compat>, DefaultIgnore; 751def err_templated_invalid_declaration : Error< 752 "a static_assert declaration cannot be a template">; 753def err_multiple_template_declarators : Error< 754 "%select{|a template declaration|an explicit template specialization|" 755 "an explicit template instantiation}0 can " 756 "only %select{|declare|declare|instantiate}0 a single entity">; 757def err_explicit_instantiation_with_definition : Error< 758 "explicit template instantiation cannot have a definition; if this " 759 "definition is meant to be an explicit specialization, add '<>' after the " 760 "'template' keyword">; 761def err_template_defn_explicit_instantiation : Error< 762 "%select{function|class|variable}0 cannot be defined in an explicit instantiation; if this " 763 "declaration is meant to be a %select{function|class|variable}0 definition, remove the 'template' keyword">; 764def err_friend_explicit_instantiation : Error< 765 "friend cannot be declared in an explicit instantiation; if this " 766 "declaration is meant to be a friend declaration, remove the 'template' keyword">; 767def err_explicit_instantiation_enum : Error< 768 "enumerations cannot be explicitly instantiated">; 769def err_expected_template_parameter : Error<"expected template parameter">; 770def err_empty_requires_expr : Error< 771 "a requires expression must contain at least one requirement">; 772def err_requires_expr_parameter_list_ellipsis : Error< 773 "varargs not allowed in requires expression">; 774def err_expected_semi_requirement : Error< 775 "expected ';' at end of requirement">; 776def err_requires_expr_missing_arrow : Error< 777 "expected '->' before expression type requirement">; 778def err_requires_expr_expected_type_constraint : Error< 779 "expected concept name with optional arguments">; 780def err_requires_expr_simple_requirement_noexcept : Error< 781 "'noexcept' can only be used in a compound requirement (with '{' '}' around " 782 "the expression)">; 783def warn_requires_expr_in_simple_requirement : Warning< 784 "this requires expression will only be checked for syntactic validity; did " 785 "you intend to place it in a nested requirement? (add another 'requires' " 786 "before the expression)">, InGroup<DiagGroup<"requires-expression">>; 787 788def err_missing_dependent_template_keyword : Error< 789 "use 'template' keyword to treat '%0' as a dependent template name">; 790def warn_missing_dependent_template_keyword : ExtWarn< 791 "use 'template' keyword to treat '%0' as a dependent template name">; 792 793def ext_extern_template : Extension< 794 "extern templates are a C++11 extension">, InGroup<CXX11>; 795def warn_cxx98_compat_extern_template : Warning< 796 "extern templates are incompatible with C++98">, 797 InGroup<CXX98CompatPedantic>, DefaultIgnore; 798def warn_static_inline_explicit_inst_ignored : Warning< 799 "ignoring '%select{static|inline}0' keyword on explicit template " 800 "instantiation">, InGroup<DiagGroup<"static-inline-explicit-instantiation">>; 801 802// Constructor template diagnostics. 803def err_out_of_line_constructor_template_id : Error< 804 "out-of-line constructor for %0 cannot have template arguments">; 805 806def err_expected_qualified_after_typename : Error< 807 "expected a qualified name after 'typename'">; 808def warn_expected_qualified_after_typename : ExtWarn< 809 "expected a qualified name after 'typename'">; 810 811def err_typename_refers_to_non_type_template : Error< 812 "typename specifier refers to a non-type template">; 813def err_expected_type_name_after_typename : Error< 814 "expected an identifier or template-id after '::'">; 815def err_explicit_spec_non_template : Error< 816 "explicit %select{specialization|instantiation}0 of " 817 "%select{non-|undeclared }3template %1 %2">; 818 819def err_default_template_template_parameter_not_template : Error< 820 "default template argument for a template template parameter must be a class " 821 "template">; 822 823def ext_fold_expression : ExtWarn< 824 "pack fold expression is a C++17 extension">, 825 InGroup<CXX17>; 826def warn_cxx14_compat_fold_expression : Warning< 827 "pack fold expression is incompatible with C++ standards before C++17">, 828 InGroup<CXXPre17Compat>, DefaultIgnore; 829def err_expected_fold_operator : Error< 830 "expected a foldable binary operator in fold expression">; 831def err_fold_operator_mismatch : Error< 832 "operators in fold expression must be the same">; 833 834def err_ctor_init_missing_comma : Error< 835 "missing ',' between base or member initializers">; 836 837// C++ declarations 838def err_friend_decl_defines_type : Error< 839 "cannot define a type in a friend declaration">; 840def err_missing_whitespace_digraph : Error< 841 "found '<::' after a " 842 "%select{template name|addrspace_cast|const_cast|dynamic_cast|reinterpret_cast|static_cast}0" 843 " which forms the digraph '<:' (aka '[') and a ':', did you mean '< ::'?">; 844 845def ext_defaulted_deleted_function : ExtWarn< 846 "%select{defaulted|deleted}0 function definitions are a C++11 extension">, 847 InGroup<CXX11>; 848def warn_cxx98_compat_defaulted_deleted_function : Warning< 849 "%select{defaulted|deleted}0 function definitions are incompatible with C++98">, 850 InGroup<CXX98Compat>, DefaultIgnore; 851 852// C++11 in-class member initialization 853def ext_nonstatic_member_init : ExtWarn< 854 "in-class initialization of non-static data member is a C++11 extension">, 855 InGroup<CXX11>; 856def warn_cxx98_compat_nonstatic_member_init : Warning< 857 "in-class initialization of non-static data members is incompatible with C++98">, 858 InGroup<CXX98Compat>, DefaultIgnore; 859def ext_bitfield_member_init: ExtWarn< 860 "default member initializer for bit-field is a C++20 extension">, 861 InGroup<CXX20>; 862def warn_cxx17_compat_bitfield_member_init: Warning< 863 "default member initializer for bit-field is incompatible with " 864 "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore; 865def err_incomplete_array_member_init: Error< 866 "array bound cannot be deduced from an in-class initializer">; 867 868// C++11 alias-declaration 869def ext_alias_declaration : ExtWarn< 870 "alias declarations are a C++11 extension">, InGroup<CXX11>; 871def warn_cxx98_compat_alias_declaration : Warning< 872 "alias declarations are incompatible with C++98">, 873 InGroup<CXX98Compat>, DefaultIgnore; 874def err_alias_declaration_not_identifier : Error< 875 "name defined in alias declaration must be an identifier">; 876def err_alias_declaration_specialization : Error< 877 "%select{partial specialization|explicit specialization|explicit instantiation}0 of alias templates is not permitted">; 878def err_alias_declaration_pack_expansion : Error< 879 "alias declaration cannot be a pack expansion">; 880 881// C++17 using-declaration pack expansions 882def ext_multi_using_declaration : ExtWarn< 883 "use of multiple declarators in a single using declaration is " 884 "a C++17 extension">, InGroup<CXX17>; 885def warn_cxx17_compat_multi_using_declaration : Warning< 886 "use of multiple declarators in a single using declaration is " 887 "incompatible with C++ standards before C++17">, 888 InGroup<CXXPre17Compat>, DefaultIgnore; 889def ext_using_declaration_pack : ExtWarn< 890 "pack expansion of using declaration is a C++17 extension">, InGroup<CXX17>; 891def warn_cxx17_compat_using_declaration_pack : Warning< 892 "pack expansion using declaration is incompatible with C++ standards " 893 "before C++17">, InGroup<CXXPre17Compat>, DefaultIgnore; 894 895// C++11 override control 896def ext_override_control_keyword : ExtWarn< 897 "'%0' keyword is a C++11 extension">, InGroup<CXX11>; 898def warn_cxx98_compat_override_control_keyword : Warning< 899 "'%0' keyword is incompatible with C++98">, 900 InGroup<CXX98Compat>, DefaultIgnore; 901def err_override_control_interface : Error< 902 "'%0' keyword not permitted with interface types">; 903def ext_ms_sealed_keyword : ExtWarn< 904 "'sealed' keyword is a Microsoft extension">, 905 InGroup<MicrosoftSealed>; 906 907def err_access_specifier_interface : Error< 908 "interface types cannot specify '%select{private|protected}0' access">; 909 910def err_duplicate_virt_specifier : Error< 911 "class member already marked '%0'">; 912 913def err_expected_parameter_pack : Error< 914 "expected the name of a parameter pack">; 915def err_paren_sizeof_parameter_pack : Error< 916 "missing parentheses around the size of parameter pack %0">; 917def err_sizeof_parameter_pack : Error< 918 "expected parenthesized parameter pack name in 'sizeof...' expression">; 919 920// C++11 lambda expressions 921def err_expected_comma_or_rsquare : Error< 922 "expected ',' or ']' in lambda capture list">; 923def err_this_captured_by_reference : Error< 924 "'this' cannot be captured by reference">; 925def err_expected_capture : Error< 926 "expected variable name or 'this' in lambda capture list">; 927def err_expected_lambda_body : Error<"expected body of lambda expression">; 928def warn_cxx98_compat_lambda : Warning< 929 "lambda expressions are incompatible with C++98">, 930 InGroup<CXX98Compat>, DefaultIgnore; 931def err_lambda_missing_parens : Error< 932 "lambda requires '()' before %select{'mutable'|return type|" 933 "attribute specifier|'constexpr'|'consteval'|'requires' clause}0">; 934def err_lambda_decl_specifier_repeated : Error< 935 "%select{'mutable'|'constexpr'|'consteval'}0 cannot appear multiple times in a lambda declarator">; 936def err_lambda_capture_misplaced_ellipsis : Error< 937 "ellipsis in pack %select{|init-}0capture must appear %select{after|before}0 " 938 "the name of the capture">; 939def err_lambda_capture_multiple_ellipses : Error< 940 "multiple ellipses in pack capture">; 941// C++17 lambda expressions 942def err_expected_star_this_capture : Error< 943 "expected 'this' following '*' in lambda capture list">; 944 945// C++17 constexpr lambda expressions 946def warn_cxx14_compat_constexpr_on_lambda : Warning< 947 "constexpr on lambda expressions is incompatible with C++ standards before C++17">, 948 InGroup<CXXPre17Compat>, DefaultIgnore; 949def ext_constexpr_on_lambda_cxx17 : ExtWarn< 950 "'constexpr' on lambda expressions is a C++17 extension">, InGroup<CXX17>; 951 952// C++20 template lambdas 953def ext_lambda_template_parameter_list: ExtWarn< 954 "explicit template parameter list for lambdas is a C++20 extension">, 955 InGroup<CXX20>; 956def warn_cxx17_compat_lambda_template_parameter_list: Warning< 957 "explicit template parameter list for lambdas is incompatible with " 958 "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore; 959def err_lambda_template_parameter_list_empty : Error< 960 "lambda template parameter list cannot be empty">; 961 962// Availability attribute 963def err_expected_version : Error< 964 "expected a version of the form 'major[.minor[.subminor]]'">; 965def warn_expected_consistent_version_separator : Warning< 966 "use same version number separators '_' or '.'; as in " 967 "'major[.minor[.subminor]]'">, InGroup<Availability>; 968def err_zero_version : Error< 969 "version number must have non-zero major, minor, or sub-minor version">; 970def err_availability_expected_platform : Error< 971 "expected a platform name, e.g., 'macos'">; 972 973// objc_bridge_related attribute 974def err_objcbridge_related_expected_related_class : Error< 975 "expected a related ObjectiveC class name, e.g., 'NSColor'">; 976def err_objcbridge_related_selector_name : Error< 977 "expected a class method selector with single argument, e.g., 'colorWithCGColor:'">; 978 979def err_availability_expected_change : Error< 980 "expected 'introduced', 'deprecated', or 'obsoleted'">; 981def err_availability_unknown_change : Error< 982 "%0 is not an availability stage; use 'introduced', 'deprecated', or " 983 "'obsoleted'">; 984def err_availability_redundant : Error< 985 "redundant %0 availability change; only the last specified change will " 986 "be used">; 987def warn_availability_and_unavailable : Warning< 988 "'unavailable' availability overrides all other availability information">, 989 InGroup<Availability>; 990 991// @available(...) 992def err_avail_query_expected_platform_name : Error< 993 "expected a platform name here">; 994 995def err_avail_query_unrecognized_platform_name : Error< 996 "unrecognized platform name %0">; 997def err_availability_query_wildcard_required: Error< 998 "must handle potential future platforms with '*'">; 999def err_availability_query_repeated_platform: Error< 1000 "version for '%0' already specified">; 1001def err_availability_query_repeated_star : Error< 1002 "'*' query has already been specified">; 1003 1004// External source symbol attribute 1005def err_external_source_symbol_expected_keyword : Error< 1006 "expected 'language', 'defined_in', or 'generated_declaration'">; 1007def err_external_source_symbol_duplicate_clause : Error< 1008 "duplicate %0 clause in an 'external_source_symbol' attribute">; 1009 1010// Type safety attributes 1011def err_type_safety_unknown_flag : Error< 1012 "invalid comparison flag %0; use 'layout_compatible' or 'must_be_null'">; 1013 1014// Type traits 1015def err_type_trait_arity : Error< 1016 "type trait requires %0%select{| or more}1 argument%select{|s}2; have " 1017 "%3 argument%s3">; 1018 1019// Language specific pragmas 1020// - Generic warnings 1021def warn_pragma_expected_lparen : Warning< 1022 "missing '(' after '#pragma %0' - ignoring">, InGroup<IgnoredPragmas>; 1023def warn_pragma_expected_rparen : Warning< 1024 "missing ')' after '#pragma %0' - ignoring">, InGroup<IgnoredPragmas>; 1025def warn_pragma_expected_identifier : Warning< 1026 "expected identifier in '#pragma %0' - ignored">, InGroup<IgnoredPragmas>; 1027def warn_pragma_expected_string : Warning< 1028 "expected string literal in '#pragma %0' - ignoring">, InGroup<IgnoredPragmas>; 1029def warn_pragma_missing_argument : Warning< 1030 "missing argument to '#pragma %0'%select{|; expected %2}1">, InGroup<IgnoredPragmas>; 1031def warn_pragma_invalid_argument : Warning< 1032 "unexpected argument '%0' to '#pragma %1'%select{|; expected %3}2">, InGroup<IgnoredPragmas>; 1033 1034def err_pragma_misplaced_in_decl : Error<"this pragma cannot appear in %0 declaration">; 1035 1036// CHERI C support. 1037def err_pragma_pointer_interpretation_invalid_argument : Error< 1038 "unexpected argument '%0' to '#pragma pointer_interpretation'; " 1039 "expected 'push', 'pop', 'default', 'integer' or 'capability'">; 1040 1041// '#pragma clang section' related errors 1042def err_pragma_expected_clang_section_name : Error< 1043 "expected one of [bss|data|rodata|text|relro] section kind in '#pragma %0'">; 1044def err_pragma_clang_section_expected_equal : Error< 1045 "expected '=' following '#pragma clang section %select{invalid|bss|data|rodata|text|relro}0'">; 1046def warn_pragma_expected_section_name : Warning< 1047 "expected a string literal for the section name in '#pragma %0' - ignored">, 1048 InGroup<IgnoredPragmas>; 1049 1050def warn_pragma_expected_section_push_pop_or_name : Warning< 1051 "expected push, pop or a string literal for the section name in '#pragma %0' - ignored">, 1052 InGroup<IgnoredPragmas>; 1053def warn_pragma_expected_section_label_or_name : Warning< 1054 "expected a stack label or a string literal for the section name in '#pragma %0' - ignored">, 1055 InGroup<IgnoredPragmas>; 1056def warn_pragma_expected_init_seg : Warning< 1057 "expected 'compiler', 'lib', 'user', or a string literal for the section name in '#pragma %0' - ignored">, 1058 InGroup<IgnoredPragmas>; 1059 1060def err_pragma_expected_integer : Error<"expected an integer argument in '#pragma %0'">; 1061def warn_pragma_expected_integer : Warning< 1062 "expected integer between %0 and %1 inclusive in '#pragma %2' - ignored">, 1063 InGroup<IgnoredPragmas>; 1064def warn_pragma_ms_struct : Warning< 1065 "incorrect use of '#pragma ms_struct on|off' - ignored">, 1066 InGroup<IgnoredPragmas>; 1067def warn_pragma_extra_tokens_at_eol : Warning< 1068 "extra tokens at end of '#pragma %0' - ignored">, 1069 InGroup<IgnoredPragmas>; 1070def warn_pragma_expected_comma : Warning< 1071 "expected ',' in '#pragma %0'">, InGroup<IgnoredPragmas>; 1072def warn_pragma_expected_punc : Warning< 1073 "expected ')' or ',' in '#pragma %0'">, InGroup<IgnoredPragmas>; 1074def warn_pragma_expected_non_wide_string : Warning< 1075 "expected non-wide string literal in '#pragma %0'">, InGroup<IgnoredPragmas>; 1076// - Generic errors 1077def err_pragma_missing_argument : Error< 1078 "missing argument to '#pragma %0'%select{|; expected %2}1">; 1079// - #pragma options 1080def warn_pragma_options_expected_align : Warning< 1081 "expected 'align' following '#pragma options' - ignored">, 1082 InGroup<IgnoredPragmas>; 1083def warn_pragma_align_expected_equal : Warning< 1084 "expected '=' following '#pragma %select{align|options align}0' - ignored">, 1085 InGroup<IgnoredPragmas>; 1086def warn_pragma_align_invalid_option : Warning< 1087 "invalid alignment option in '#pragma %select{align|options align}0' - ignored">, 1088 InGroup<IgnoredPragmas>; 1089// - #pragma pack 1090def warn_pragma_unsupported_action : Warning< 1091 "known but unsupported action '%1' for '#pragma %0' - ignored">, 1092 InGroup<IgnoredPragmas>; 1093def warn_pragma_invalid_specific_action : Warning< 1094 "unknown action '%1' for '#pragma %0' - ignored">, 1095 InGroup<IgnoredPragmas>; 1096def warn_pragma_expected_action_or_r_paren : Warning< 1097 "expected action or ')' in '#pragma %0' - ignored">, 1098 InGroup<IgnoredPragmas>; 1099def warn_pragma_invalid_action : Warning< 1100 "unknown action for '#pragma %0' - ignored">, 1101 InGroup<IgnoredPragmas>; 1102def warn_pragma_pack_malformed : Warning< 1103 "expected integer or identifier in '#pragma pack' - ignored">, 1104 InGroup<IgnoredPragmas>; 1105// - #pragma intrinsic 1106def warn_pragma_intrinsic_builtin : Warning< 1107 "%0 is not a recognized builtin%select{|; consider including <intrin.h> to access non-builtin intrinsics}1">, 1108 InGroup<IgnoredPragmaIntrinsic>; 1109// - #pragma optimize 1110def warn_pragma_optimize : Warning< 1111 "'#pragma optimize' is not supported">, 1112 InGroup<IgnoredPragmaOptimize>; 1113// - #pragma unused 1114def warn_pragma_unused_expected_var : Warning< 1115 "expected '#pragma unused' argument to be a variable name">, 1116 InGroup<IgnoredPragmas>; 1117// - #pragma init_seg 1118def warn_pragma_init_seg_unsupported_target : Warning< 1119 "'#pragma init_seg' is only supported when targeting a " 1120 "Microsoft environment">, 1121 InGroup<IgnoredPragmas>; 1122// - #pragma restricted to file scope or start of compound statement 1123def err_pragma_file_or_compound_scope : Error< 1124 "'#pragma %0' can only appear at file scope or at the start of a " 1125 "compound statement">; 1126// - #pragma stdc unknown 1127def ext_stdc_pragma_ignored : ExtWarn<"unknown pragma in STDC namespace">, 1128 InGroup<UnknownPragmas>; 1129def warn_stdc_fenv_access_not_supported : 1130 Warning<"pragma STDC FENV_ACCESS ON is not supported, ignoring pragma">, 1131 InGroup<UnknownPragmas>; 1132// - #pragma comment 1133def err_pragma_comment_malformed : Error< 1134 "pragma comment requires parenthesized identifier and optional string">; 1135def err_pragma_comment_unknown_kind : Error<"unknown kind of pragma comment">; 1136// PS4 recognizes only #pragma comment(lib) 1137def warn_pragma_comment_ignored : Warning<"'#pragma comment %0' ignored">, 1138 InGroup<IgnoredPragmas>; 1139// - #pragma detect_mismatch 1140def err_pragma_detect_mismatch_malformed : Error< 1141 "pragma detect_mismatch is malformed; it requires two comma-separated " 1142 "string literals">; 1143// - #pragma float_control 1144def err_pragma_float_control_malformed : Error< 1145 "pragma float_control is malformed; use 'float_control({push|pop})' or " 1146 "'float_control({precise|except}, {on|off} [,push])'">; 1147// - #pragma pointers_to_members 1148def err_pragma_pointers_to_members_unknown_kind : Error< 1149 "unexpected %0, expected to see one of %select{|'best_case', 'full_generality', }1" 1150 "'single_inheritance', 'multiple_inheritance', or 'virtual_inheritance'">; 1151// - #pragma clang optimize on/off 1152def err_pragma_optimize_invalid_argument : Error< 1153 "unexpected argument '%0' to '#pragma clang optimize'; " 1154 "expected 'on' or 'off'">; 1155def err_pragma_optimize_extra_argument : Error< 1156 "unexpected extra argument '%0' to '#pragma clang optimize'">; 1157// - #pragma clang attribute 1158def err_pragma_attribute_expected_push_pop_paren : Error< 1159 "expected 'push', 'pop', or '(' after '#pragma clang attribute'">; 1160def err_pragma_attribute_invalid_argument : Error< 1161 "unexpected argument '%0' to '#pragma clang attribute'; " 1162 "expected 'push' or 'pop'">; 1163def err_pragma_attribute_expected_attribute : Error< 1164 "expected an attribute after '('">; 1165def err_pragma_attribute_expected_attribute_name : Error< 1166 "expected identifier that represents an attribute name">; 1167def err_pragma_attribute_extra_tokens_after_attribute : Error< 1168 "extra tokens after attribute in a '#pragma clang attribute push'">; 1169def err_pragma_attribute_unsupported_attribute : Error< 1170 "attribute %0 is not supported by '#pragma clang attribute'">; 1171def err_pragma_attribute_multiple_attributes : Error< 1172 "more than one attribute specified in '#pragma clang attribute push'">; 1173def err_pragma_attribute_expected_attribute_syntax : Error< 1174 "expected an attribute that is specified using the GNU, C++11 or '__declspec'" 1175 " syntax">; 1176def note_pragma_attribute_use_attribute_kw : Note<"use the GNU '__attribute__' " 1177 "syntax">; 1178def err_pragma_attribute_invalid_subject_set_specifier : Error< 1179 "expected attribute subject set specifier 'apply_to'">; 1180def err_pragma_attribute_expected_subject_identifier : Error< 1181 "expected an identifier that corresponds to an attribute subject rule">; 1182def err_pragma_attribute_unknown_subject_rule : Error< 1183 "unknown attribute subject rule '%0'">; 1184def err_pragma_attribute_expected_subject_sub_identifier : Error< 1185 "expected an identifier that corresponds to an attribute subject matcher " 1186 "sub-rule; '%0' matcher %select{does not support sub-rules|supports the " 1187 "following sub-rules: %2|}1">; 1188def err_pragma_attribute_unknown_subject_sub_rule : Error< 1189 "%select{invalid use of|unknown}2 attribute subject matcher sub-rule '%0'; " 1190 "'%1' matcher %select{does not support sub-rules|supports the following " 1191 "sub-rules: %3}2">; 1192def err_pragma_attribute_duplicate_subject : Error< 1193 "duplicate attribute subject matcher '%0'">; 1194def err_pragma_attribute_expected_period : Error< 1195 "expected '.' after pragma attribute namespace %0">; 1196def err_pragma_attribute_namespace_on_attribute : Error< 1197 "namespace can only apply to 'push' or 'pop' directives">; 1198def note_pragma_attribute_namespace_on_attribute : Note< 1199 "omit the namespace to add attributes to the most-recently" 1200 " pushed attribute group">; 1201 1202def err_opencl_unroll_hint_on_non_loop : Error< 1203 "OpenCL only supports 'opencl_unroll_hint' attribute on for, while, and do statements">; 1204 1205// OpenCL EXTENSION pragma (OpenCL 1.1 [9.1]) 1206def warn_pragma_expected_colon : Warning< 1207 "missing ':' after %0 - ignoring">, InGroup<IgnoredPragmas>; 1208def warn_pragma_expected_predicate : Warning< 1209 "expected %select{'enable', 'disable', 'begin' or 'end'|'disable'}0 - ignoring">, InGroup<IgnoredPragmas>; 1210def warn_pragma_begin_end_mismatch : Warning< 1211 "OpenCL extension end directive mismatches begin directive - ignoring">, InGroup<IgnoredPragmas>; 1212def warn_pragma_unknown_extension : Warning< 1213 "unknown OpenCL extension %0 - ignoring">, InGroup<IgnoredPragmas>; 1214def warn_pragma_unsupported_extension : Warning< 1215 "unsupported OpenCL extension %0 - ignoring">, InGroup<IgnoredPragmas>; 1216def warn_pragma_extension_is_core : Warning< 1217 "OpenCL extension %0 is core feature or supported optional core feature - ignoring">, InGroup<DiagGroup<"pedantic-core-features">>, DefaultIgnore; 1218 1219// OpenCL errors. 1220def err_opencl_taking_function_address_parser : Error< 1221 "taking address of function is not allowed">; 1222def err_opencl_logical_exclusive_or : Error< 1223 "^^ is a reserved operator in OpenCL">; 1224 1225// C++ for OpenCL. 1226def err_openclcxx_virtual_function : Error< 1227 "virtual functions are not supported in C++ for OpenCL">; 1228 1229// OpenMP support. 1230def warn_pragma_omp_ignored : Warning< 1231 "unexpected '#pragma omp ...' in program">, InGroup<SourceUsesOpenMP>, DefaultIgnore; 1232def warn_omp_extra_tokens_at_eol : Warning< 1233 "extra tokens at the end of '#pragma omp %0' are ignored">, 1234 InGroup<ExtraTokens>; 1235def warn_pragma_expected_colon_r_paren : Warning< 1236 "missing ':' or ')' after %0 - ignoring">, InGroup<IgnoredPragmas>; 1237def err_omp_unknown_directive : Error< 1238 "expected an OpenMP directive">; 1239def err_omp_unexpected_directive : Error< 1240 "unexpected OpenMP directive %select{|'#pragma omp %1'}0">; 1241def err_omp_expected_punc : Error< 1242 "expected ',' or ')' in '%0' %select{clause|directive}1">; 1243def err_omp_unexpected_clause : Error< 1244 "unexpected OpenMP clause '%0' in directive '#pragma omp %1'">; 1245def err_omp_immediate_directive : Error< 1246 "'#pragma omp %0' %select{|with '%2' clause }1cannot be an immediate substatement">; 1247def err_omp_expected_identifier_for_critical : Error< 1248 "expected identifier specifying the name of the 'omp critical' directive">; 1249def err_omp_expected_reduction_identifier : Error< 1250 "expected identifier or one of the following operators: '+', '-', '*', '&', '|', '^', '&&', or '||'">; 1251def err_omp_expected_equal_in_iterator : Error< 1252 "expected '=' in iterator specifier">; 1253def err_omp_expected_punc_after_iterator : Error< 1254 "expected ',' or ')' after iterator specifier">; 1255def err_omp_decl_in_declare_simd_variant : Error< 1256 "function declaration is expected after 'declare %select{simd|variant}0' directive">; 1257def err_omp_unknown_map_type : Error< 1258 "incorrect map type, expected one of 'to', 'from', 'tofrom', 'alloc', 'release', or 'delete'">; 1259def err_omp_unknown_map_type_modifier : Error< 1260 "incorrect map type modifier, expected 'always', 'close', or 'mapper'">; 1261def err_omp_map_type_missing : Error< 1262 "missing map type">; 1263def err_omp_map_type_modifier_missing : Error< 1264 "missing map type modifier">; 1265def err_omp_declare_simd_inbranch_notinbranch : Error< 1266 "unexpected '%0' clause, '%1' is specified already">; 1267def err_expected_end_declare_target_or_variant : Error< 1268 "expected '#pragma omp end declare %select{target|variant}0'">; 1269def err_expected_begin_declare_variant 1270 : Error<"'#pragma omp end declare variant' with no matching '#pragma omp " 1271 "begin declare variant'">; 1272def err_omp_declare_target_unexpected_clause: Error< 1273 "unexpected '%0' clause, only %select{'to' or 'link'|'to', 'link' or 'device_type'}1 clauses expected">; 1274def err_omp_expected_clause: Error< 1275 "expected at least one clause on '#pragma omp %0' directive">; 1276def err_omp_mapper_illegal_identifier : Error< 1277 "illegal OpenMP user-defined mapper identifier">; 1278def err_omp_mapper_expected_declarator : Error< 1279 "expected declarator on 'omp declare mapper' directive">; 1280def err_omp_declare_variant_wrong_clause : Error< 1281 "expected '%0' clause on 'omp declare variant' directive">; 1282def warn_omp_declare_variant_string_literal_or_identifier 1283 : Warning<"expected identifier or string literal describing a context " 1284 "%select{set|selector|property}0; " 1285 "%select{set|selector|property}0 skipped">, 1286 InGroup<OpenMPClauses>; 1287def note_omp_declare_variant_ctx_options 1288 : Note<"context %select{set|selector|property}0 options are: %1">; 1289def warn_omp_declare_variant_expected 1290 : Warning<"expected '%0' after the %1; '%0' assumed">, 1291 InGroup<OpenMPClauses>; 1292def warn_omp_declare_variant_ctx_not_a_property 1293 : Warning<"'%0' is not a valid context property for the context selector " 1294 "'%1' and the context set '%2'; property ignored">, 1295 InGroup<OpenMPClauses>; 1296def note_omp_declare_variant_ctx_is_a 1297 : Note<"'%0' is a context %select{set|selector|property}1 not a context " 1298 "%select{set|selector|property}2">; 1299def note_omp_declare_variant_ctx_try : Note<"try 'match(%0={%1%2})'">; 1300def warn_omp_declare_variant_ctx_not_a_selector 1301 : Warning<"'%0' is not a valid context selector for the context set '%1'; " 1302 "selector ignored">, 1303 InGroup<OpenMPClauses>; 1304def warn_omp_declare_variant_ctx_not_a_set 1305 : Warning<"'%0' is not a valid context set in a `declare variant`; set " 1306 "ignored">, 1307 InGroup<OpenMPClauses>; 1308def warn_omp_declare_variant_ctx_mutiple_use 1309 : Warning<"the context %select{set|selector|property}0 '%1' was used " 1310 "already in the same 'omp declare variant' directive; " 1311 "%select{set|selector|property}0 ignored">, 1312 InGroup<OpenMPClauses>; 1313def note_omp_declare_variant_ctx_used_here 1314 : Note<"the previous context %select{set|selector|property}0 '%1' used " 1315 "here">; 1316def note_omp_declare_variant_ctx_continue_here 1317 : Note<"the ignored %select{set|selector|property}0 spans until here">; 1318def warn_omp_ctx_incompatible_selector_for_set 1319 : Warning<"the context selector '%0' is not valid for the context set " 1320 "'%1'; selector ignored">, 1321 InGroup<OpenMPClauses>; 1322def note_omp_ctx_compatible_set_for_selector 1323 : Note<"the context selector '%0' can be nested in the context set '%1'; " 1324 "try 'match(%1={%0%select{|(property)}2})'">; 1325def warn_omp_ctx_selector_without_properties 1326 : Warning<"the context selector '%0' in context set '%1' requires a " 1327 "context property defined in parentheses; selector ignored">, 1328 InGroup<OpenMPClauses>; 1329def warn_omp_ctx_incompatible_property_for_selector 1330 : Warning<"the context property '%0' is not valid for the context selector " 1331 "'%1' and the context set '%2'; property ignored">, 1332 InGroup<OpenMPClauses>; 1333def note_omp_ctx_compatible_set_and_selector_for_property 1334 : Note<"the context property '%0' can be nested in the context selector " 1335 "'%1' which is nested in the context set '%2'; try " 1336 "'match(%2={%1(%0)})'">; 1337def warn_omp_ctx_incompatible_score_for_property 1338 : Warning<"the context selector '%0' in the context set '%1' cannot have a " 1339 "score ('%2'); score ignored">, 1340 InGroup<OpenMPClauses>; 1341def warn_omp_more_one_device_type_clause 1342 : Warning<"more than one 'device_type' clause is specified">, 1343 InGroup<OpenMPClauses>; 1344def err_omp_variant_ctx_second_match_extension : Error< 1345 "only a single match extension allowed per OpenMP context selector">; 1346def err_omp_invalid_dsa: Error< 1347 "data-sharing attribute '%0' in '%1' clause requires OpenMP version %2 or above">; 1348 1349// Pragma loop support. 1350def err_pragma_loop_missing_argument : Error< 1351 "missing argument; expected %select{an integer value|" 1352 "'enable'%select{|, 'full'}1%select{|, 'assume_safety'}2 or 'disable'}0">; 1353def err_pragma_loop_invalid_option : Error< 1354 "%select{invalid|missing}0 option%select{ %1|}0; expected vectorize, " 1355 "vectorize_width, interleave, interleave_count, unroll, unroll_count, " 1356 "pipeline, pipeline_initiation_interval, vectorize_predicate, or distribute">; 1357 1358def err_pragma_fp_invalid_option : Error< 1359 "%select{invalid|missing}0 option%select{ %1|}0; expected 'contract' or 'reassociate'">; 1360def err_pragma_fp_invalid_argument : Error< 1361 "unexpected argument '%0' to '#pragma clang fp %1'; " 1362 "%select{" 1363 "expected 'fast' or 'on' or 'off'|" 1364 "expected 'on' or 'off'}2">; 1365 1366def err_pragma_invalid_keyword : Error< 1367 "invalid argument; expected 'enable'%select{|, 'full'}0%select{|, 'assume_safety'}1 or 'disable'">; 1368def err_pragma_pipeline_invalid_keyword : Error< 1369 "invalid argument; expected 'disable'">; 1370 1371// Pragma unroll support. 1372def warn_pragma_unroll_cuda_value_in_parens : Warning< 1373 "argument to '#pragma unroll' should not be in parentheses in CUDA C/C++">, 1374 InGroup<CudaCompat>; 1375 1376def warn_cuda_attr_lambda_position : Warning< 1377 "nvcc does not allow '__%0__' to appear after '()' in lambdas">, 1378 InGroup<CudaCompat>; 1379def warn_pragma_force_cuda_host_device_bad_arg : Warning< 1380 "incorrect use of #pragma clang force_cuda_host_device begin|end">, 1381 InGroup<IgnoredPragmas>; 1382def err_pragma_cannot_end_force_cuda_host_device : Error< 1383 "force_cuda_host_device end pragma without matching " 1384 "force_cuda_host_device begin">; 1385} // end of Parse Issue category. 1386 1387let CategoryName = "Modules Issue" in { 1388def err_unexpected_module_decl : Error< 1389 "module declaration can only appear at the top level">; 1390def err_module_expected_ident : Error< 1391 "expected a module name after '%select{module|import}0'">; 1392def err_attribute_not_module_attr : Error< 1393 "%0 attribute cannot be applied to a module">; 1394def err_attribute_not_import_attr : Error< 1395 "%0 attribute cannot be applied to a module import">; 1396def err_module_expected_semi : Error< 1397 "expected ';' after module name">; 1398def err_global_module_introducer_not_at_start : Error< 1399 "'module;' introducing a global module fragment can appear only " 1400 "at the start of the translation unit">; 1401def err_module_fragment_exported : Error< 1402 "%select{global|private}0 module fragment cannot be exported">; 1403def err_private_module_fragment_expected_semi : Error< 1404 "expected ';' after private module fragment declaration">; 1405def err_missing_before_module_end : Error<"expected %0 at end of module">; 1406def err_unsupported_module_partition : Error< 1407 "sorry, module partitions are not yet supported">; 1408 1409def err_export_empty : Error<"export declaration cannot be empty">; 1410} 1411 1412let CategoryName = "Generics Issue" in { 1413 1414def err_objc_expected_type_parameter : Error< 1415 "expected type parameter name">; 1416 1417def err_objc_parameterized_implementation : Error< 1418 "@implementation cannot have type parameters">; 1419 1420def err_objc_type_args_after_protocols : Error< 1421 "protocol qualifiers must precede type arguments">; 1422 1423def note_meant_to_use_typename : Note< 1424 "did you mean to use 'typename'?">; 1425} 1426 1427let CategoryName = "Coroutines Issue" in { 1428def err_for_co_await_not_range_for : Error< 1429 "'co_await' modifier can only be applied to range-based for loop">; 1430} 1431 1432let CategoryName = "Concepts Issue" in { 1433def err_concept_definition_not_identifier : Error< 1434 "name defined in concept definition must be an identifier">; 1435def ext_concept_legacy_bool_keyword : ExtWarn< 1436 "ISO C++20 does not permit the 'bool' keyword after 'concept'">, 1437 InGroup<DiagGroup<"concepts-ts-compat">>; 1438def err_placeholder_expected_auto_or_decltype_auto : Error< 1439 "expected 'auto' or 'decltype(auto)' after concept name">; 1440} 1441 1442def warn_max_tokens : Warning< 1443 "the number of preprocessor source tokens (%0) exceeds this token limit (%1)">, 1444 InGroup<MaxTokens>, DefaultIgnore; 1445 1446def warn_max_tokens_total : Warning< 1447 "the total number of preprocessor source tokens (%0) exceeds the token limit (%1)">, 1448 InGroup<MaxTokens>, DefaultIgnore; 1449 1450def note_max_tokens_total_override : Note<"total token limit set here">; 1451 1452} // end of Parser diagnostics 1453