//==--- DiagnosticParseKinds.def - libparse diagnostics ---------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

//===----------------------------------------------------------------------===//
// Parser Diagnostics
//===----------------------------------------------------------------------===//

#ifdef PARSESTART
__PARSESTART    = DIAG_START_PARSE,
#undef PARSESTART
#endif

DIAG(w_asm_qualifier_ignored, WARNING,
     "ignored %0 qualifier on asm")

DIAG(ext_empty_source_file, EXTENSION,
     "ISO C forbids an empty source file")
DIAG(ext_top_level_semi, EXTENSION,
     "ISO C does not allow an extra ';' outside of a function")
DIAG(ext_extra_struct_semi, EXTENSION,
     "ISO C does not allow an extra ';' inside a struct or union")

DIAG(ext_duplicate_declspec, EXTENSION,
     "duplicate '%0' declaration specifier")
DIAG(ext_plain_complex, EXTENSION,
     "ISO C does not support plain '_Complex' meaning '_Complex double'")
DIAG(ext_integer_complex, EXTENSION,
     "ISO C does not support complex integer types")
DIAG(ext_thread_before, EXTENSION,
     "'__thread' before 'static'")
     
DIAG(ext_empty_struct_union_enum, EXTENSION,
     "use of empty %0 extension")

DIAG(err_invalid_sign_spec, ERROR,
     "'%0' cannot be signed or unsigned")
DIAG(err_invalid_short_spec, ERROR,
     "'short %0' is invalid")
DIAG(err_invalid_long_spec, ERROR,
     "'long %0' is invalid")
DIAG(err_invalid_longlong_spec, ERROR,
     "'long long %0' is invalid")
DIAG(err_invalid_complex_spec, ERROR,
     "'_Complex %0' is invalid")
DIAG(err_invalid_thread_spec, ERROR,
     "'__thread %0' is invalid")

DIAG(ext_ident_list_in_param, EXTENSION,
     "type-less parameter names in function declaration")
DIAG(ext_c99_variable_decl_in_for_loop, EXTENSION,
     "variable declaration in for loop is a C99-specific feature")
DIAG(ext_c99_compound_literal, EXTENSION,
     "compound literals are a C99-specific feature")
DIAG(ext_c99_enumerator_list_comma, EXTENSION,
     "commas at the end of enumerator lists are a C99-specific feature")

DIAG(ext_gnu_indirect_goto, EXTENSION,
     "use of GNU indirect-goto extension")
DIAG(ext_gnu_address_of_label, EXTENSION,
     "use of GNU address-of-label extension")
DIAG(ext_gnu_statement_expr, EXTENSION,
     "use of GNU statement expression extension")
DIAG(ext_gnu_conditional_expr, EXTENSION,
     "use of GNU ?: expression extension, eliding middle term")
DIAG(ext_gnu_empty_initializer, EXTENSION,
     "use of GNU empty initializer extension")
DIAG(ext_gnu_array_range, EXTENSION,
     "use of GNU array range extension")
DIAG(ext_gnu_missing_equal_designator, EXTENSION,
     "use of GNU 'missing =' extension in designator")
DIAG(err_expected_equal_designator, ERROR,
     "expected '=' or another designator")
DIAG(ext_gnu_old_style_field_designator, EXTENSION,
     "use of GNU old-style field designator extension")
DIAG(ext_gnu_case_range, EXTENSION,
     "use of GNU case range extension")

// Generic errors.
DIAG(err_parse_error, ERROR,
     "parse error")
DIAG(err_expected_expression, ERROR,
     "expected expression")
DIAG(err_expected_type, ERROR,
     "expected a type")
DIAG(err_expected_external_declaration, ERROR,
     "expected external declaration")
DIAG(err_expected_ident, ERROR,
     "expected identifier")
DIAG(err_expected_ident_lparen, ERROR,
     "expected identifier or '('")
DIAG(err_expected_ident_lbrace, ERROR,
     "expected identifier or '{'")
DIAG(err_expected_lbrace, ERROR,
     "expected '{'")
DIAG(err_expected_lparen, ERROR,
     "expected '('")
DIAG(err_expected_rparen, ERROR,
     "expected ')'")
DIAG(err_expected_rsquare, ERROR,
     "expected ']'")
DIAG(err_expected_rbrace, ERROR,
     "expected '}'")
DIAG(err_expected_greater, ERROR,
     "expected '>'")
DIAG(err_expected_semi_decl_list, ERROR,
     "expected ';' at end of declaration list")
DIAG(ext_expected_semi_decl_list, EXTENSION,
     "expected ';' at end of declaration list")
DIAG(err_function_declared_typedef, ERROR,
     "function definition declared 'typedef'")
DIAG(err_expected_fn_body, ERROR,
     "expected function body after function declarator")
DIAG(err_expected_method_body, ERROR,
     "expected method body")
DIAG(err_expected_after_declarator, ERROR,
     "expected '=', ',', ';', 'asm', or '__attribute__' after declarator")
DIAG(err_expected_statement, ERROR,
     "expected statement")
DIAG(err_expected_lparen_after, ERROR,
     "expected '(' after '%0'")
DIAG(err_expected_lparen_after_id, ERROR,
     "expected '(' after %0")
DIAG(err_expected_less_after, ERROR,
     "expected '<' after '%0'")
DIAG(err_expected_comma, ERROR,
     "expected ','")
DIAG(err_expected_lbrace_in_compound_literal, ERROR,
     "expected '{' in compound literal")
DIAG(err_expected_while, ERROR,
     "expected 'while' in do/while loop")
DIAG(err_expected_semi_after, ERROR,
     "expected ';' after %0")
DIAG(err_expected_semi_after_expr, ERROR,
     "expected ';' after expression")
DIAG(err_expected_semi_after_method_proto, ERROR,
     "expected ';' after method prototype")
DIAG(err_expected_semi_for, ERROR,
     "expected ';' in 'for' statement specifier")
DIAG(err_expected_colon_after, ERROR,
     "expected ':' after %0")
DIAG(err_label_end_of_compound_statement, ERROR,
     "label at end of compound statement: expected statement")
DIAG(err_expected_string_literal, ERROR,
     "expected string literal")
DIAG(err_expected_asm_operand, ERROR,
     "expected string literal or '[' for asm operand")
DIAG(err_expected_selector_for_method, ERROR,
     "expected selector for Objective-C method")

DIAG(err_unexpected_at, ERROR,
     "unexpected '@' in program")

DIAG(err_invalid_reference_qualifier_application, ERROR,
     "'%0' qualifier may not be applied to a reference")
DIAG(err_illegal_decl_reference_to_reference, ERROR,
     "%0 declared as a reference to a reference")
DIAG(err_argument_required_after_attribute, ERROR,
     "argument required after attribute")
DIAG(err_missing_param, ERROR,
     "expected parameter declarator")
DIAG(err_unexpected_typedef_ident, ERROR,
     "unexpected type name %0: expected identifier")
DIAG(err_expected_class_name, ERROR,
     "expected class name")
DIAG(err_unspecified_vla_size_with_static, ERROR,
     "'static' may not be used with an unspecified variable length array size")

// Declarations.
DIAG(err_typename_requires_specqual, ERROR,
     "type name requires a specifier or qualifier")
DIAG(err_typename_invalid_storageclass, ERROR,
     "type name does not allow storage class to be specified")
DIAG(err_typename_invalid_functionspec, ERROR,
     "type name does not allow function specifier to be specified")
DIAG(err_invalid_decl_spec_combination, ERROR,
     "cannot combine with previous '%0' declaration specifier")

/// Objective-C parser diagnostics
DIAG(err_objc_no_attributes_on_category, ERROR,
     "attributes may not be specified on a category")
DIAG(err_objc_missing_end, ERROR,
     "missing @end")
DIAG(warn_objc_protocol_qualifier_missing_id, WARNING,
     "protocol qualifiers without 'id' is archaic")

DIAG(err_objc_illegal_visibility_spec, ERROR,
     "illegal visibility specification")
DIAG(err_objc_illegal_interface_qual, ERROR,
     "illegal interface qualifier")
DIAG(err_objc_expected_equal, ERROR,
     "setter/getter expects '=' followed by name")
DIAG(err_objc_property_requires_field_name, ERROR,
     "property requires fields to be named")
DIAG(err_objc_property_bitfield, ERROR,
     "property name cannot be a bitfield")
DIAG(err_objc_expected_property_attr, ERROR,
     "unknown property attribute %0")
DIAG(err_objc_propertoes_require_objc2, ERROR,
     "properties are an Objective-C 2 feature")
DIAG(err_objc_unexpected_attr, ERROR,
     "prefix attribute must be followed by an interface or protocol")
DIAG(err_objc_directive_only_in_protocol, ERROR,
     "directive may only be specified in protocols only")
DIAG(err_missing_catch_finally, ERROR,
     "@try statement without a @catch and @finally clause")
DIAG(err_objc_concat_string, ERROR,
     "unexpected token after Objective-C string")
DIAG(err_missing_sel_definition, ERROR,
     "cannot find definition of 'SEL'")
DIAG(err_missing_id_definition, ERROR,
     "cannot find definition of 'id'")
DIAG(err_missing_proto_definition, ERROR,
     "cannot find definition of 'Protocol'")
DIAG(err_missing_class_definition, ERROR,
     "cannot find definition of 'Class'")
DIAG(warn_expected_implementation, WARNING,
     "@end must appear in an @implementation context")
DIAG(error_property_ivar_decl, ERROR,
     "property synthesize requires specification of an ivar")

DIAG(err_expected_field_designator, ERROR,
     "expected a field designator, such as '.field = 4'")

DIAG(err_declaration_does_not_declare_param, ERROR,
     "declaration does not declare a parameter")
DIAG(err_no_matching_param, ERROR,
     "parameter named %0 is missing")

/// C++ parser diagnostics
DIAG(err_expected_unqualified_id, ERROR,
     "expected unqualified-id")
DIAG(err_func_def_no_params, ERROR,
     "function definition does not declare parameters")
DIAG(err_expected_lparen_after_type, ERROR,
     "expected '(' for function-style cast or type construction")
DIAG(err_expected_equal_after_declarator, ERROR,
     "expected '=' after declarator")
DIAG(warn_parens_disambiguated_as_function_decl, WARNING,
     "parentheses were disambiguated as a function declarator")
DIAG(err_expected_member_or_base_name, ERROR,
     "expected class member or base class name")
DIAG(ext_ellipsis_exception_spec, EXTENSION,
     "exception specification of '...' is a Microsoft extension")
DIAG(err_expected_catch, ERROR,
     "expected catch")

// C++ derived classes
DIAG(err_dup_virtual, ERROR,
     "duplicate 'virtual' in base specifier")

// C++ operator overloading
DIAG(err_operator_missing_type_specifier, ERROR,
     "missing type specifier after 'operator'")

// Classes.
DIAG(err_anon_type_definition, ERROR,
     "declaration of anonymous %0 must be a definition")


/// C++ Templates
DIAG(err_expected_template, ERROR,
      "expected template")
DIAG(err_expected_comma_greater, ERROR,
      "expected ',' or '>' in template-parameter-list")
DIAG(err_expected_type_id_after, ERROR,
      "expected type-id after '%0'")
DIAG(err_expected_class_before, ERROR,
      "expected 'class' before '%0'")
DIAG(err_template_spec_syntax_non_template, ERROR,
     "identifier followed by '<' indicates a class template specialization but %0 %select{does not refer to a template|refers to a function template|<unused>|refers to a template template parameter}1")

// Language specific pragmas

// #pragma pack
DIAG(warn_pragma_pack_expected_lparen, WARNING,
     "missing '(' after '#pragma pack' - ignoring")
DIAG(warn_pragma_pack_expected_rparen, WARNING,
     "missing ')' after '#pragma pack' - ignoring")
DIAG(warn_pragma_pack_invalid_action, WARNING,
     "unknown action for '#pragma pack' - ignored")
DIAG(warn_pragma_pack_invalid_constant, WARNING,
     "invalid constant for '#pragma pack', expected %0 - ignored")
DIAG(warn_pragma_pack_malformed, WARNING,
     "expected integer or identifier in '#pragma pack' - ignored")
