aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/Basic/Diagnostic.td9
-rw-r--r--include/clang/Basic/DiagnosticASTKinds.td17
-rw-r--r--include/clang/Basic/DiagnosticAnalysisKinds.td1
-rw-r--r--include/clang/Basic/DiagnosticCommonKinds.td13
-rw-r--r--include/clang/Basic/DiagnosticDriverKinds.td12
-rw-r--r--include/clang/Basic/DiagnosticFrontendKinds.td6
-rw-r--r--include/clang/Basic/DiagnosticLexKinds.td11
-rw-r--r--include/clang/Basic/DiagnosticParseKinds.td31
-rw-r--r--include/clang/Basic/DiagnosticSemaKinds.td1091
9 files changed, 1140 insertions, 51 deletions
diff --git a/include/clang/Basic/Diagnostic.td b/include/clang/Basic/Diagnostic.td
index 9846512cd6..415e7fa811 100644
--- a/include/clang/Basic/Diagnostic.td
+++ b/include/clang/Basic/Diagnostic.td
@@ -27,11 +27,12 @@ class OptionControlled;
class Warning<string text> : Diagnostic<text>, OptionControlled {
string DefaultMapping = "warning";
}
-// Special cases of warnings.
-class Extension<string text> : Warning<text> {
- let DefaultMapping = "ignore";
+class Extension<string text> : Diagnostic<text>, OptionControlled {
+ string DefaultMapping = "ignore";
+}
+class ExtWarn<string text> : Diagnostic<text>, OptionControlled {
+ string DefaultMapping = "warning";
}
-class ExtWarn<string text> : Warning<text>;
diff --git a/include/clang/Basic/DiagnosticASTKinds.td b/include/clang/Basic/DiagnosticASTKinds.td
index 9c48bd9600..f075aaaf42 100644
--- a/include/clang/Basic/DiagnosticASTKinds.td
+++ b/include/clang/Basic/DiagnosticASTKinds.td
@@ -9,8 +9,21 @@
let Component = "AST" in {
-def note_comma_in_ice : Note<
- "C does not permit evaluated commas in an integer constant expression">;
+//def note_comma_in_ice : Note<
+// "C does not permit evaluated commas in an integer constant expression">;
def note_expr_divide_by_zero : Note<"division by zero">;
+// inline asm related.
+def err_asm_invalid_escape : Error<
+ "invalid %% escape in inline assembly string">;
+def err_asm_unknown_symbolic_operand_name : Error<
+ "unknown symbolic operand name in inline assembly string">;
+
+def err_asm_unterminated_symbolic_operand_name : Error<
+ "unterminated symbolic operand name in inline assembly string">;
+def err_asm_empty_symbolic_operand_name : Error<
+ "empty symbolic operand name in inline assembly string">;
+def err_asm_invalid_operand_number : Error<
+ "invalid operand number in inline asm string">;
+
}
diff --git a/include/clang/Basic/DiagnosticAnalysisKinds.td b/include/clang/Basic/DiagnosticAnalysisKinds.td
index 2ed85fabea..46dc0e60a7 100644
--- a/include/clang/Basic/DiagnosticAnalysisKinds.td
+++ b/include/clang/Basic/DiagnosticAnalysisKinds.td
@@ -9,6 +9,7 @@
let Component = "Analysis" in {
+// CHECK: use of uninitialized values
def warn_uninit_val : Warning<"use of uninitialized variable">;
}
diff --git a/include/clang/Basic/DiagnosticCommonKinds.td b/include/clang/Basic/DiagnosticCommonKinds.td
index 33852f1686..5090f7bcdb 100644
--- a/include/clang/Basic/DiagnosticCommonKinds.td
+++ b/include/clang/Basic/DiagnosticCommonKinds.td
@@ -1,4 +1,4 @@
-//==--- DiagnosticCommonKinds.td - common diagnostics --------------------===//
+//==--- DiagnosticCommonKinds.td - common diagnostics ---------------------===//
//
// The LLVM Compiler Infrastructure
//
@@ -22,18 +22,24 @@ def note_duplicate_case_prev : Note<"previous case defined here">;
def note_forward_declaration : Note<"forward declaration of %0">;
def note_type_being_defined : Note<
"definition of %0 is not complete until the closing '}'">;
+/// note_matching - this is used as a continuation of a previous diagnostic,
+/// e.g. to specify the '(' when we expected a ')'.
def note_matching : Note<"to match this '%0'">;
+
def note_using_decl : Note<"using">;
def note_also_found_decl : Note<"also found">;
+// Parse && Lex
def err_expected_colon : Error<"expected ':'">;
+// Parse && Sema
def err_no_declarators : Error<"declaration does not declare anything">;
def err_param_redefinition : Error<"redefinition of parameter %0">;
def err_invalid_storage_class_in_func_decl : Error<
"invalid storage class specifier in function declarator">;
def err_expected_namespace_name : Error<"expected namespace name">;
+// Sema && Lex
def ext_longlong : Extension<
"'long long' is an extension when C99 mode is not enabled">;
def warn_integer_too_large : Warning<
@@ -41,12 +47,15 @@ def warn_integer_too_large : Warning<
def warn_integer_too_large_for_signed : Warning<
"integer constant is so large that it is unsigned">;
+// Sema && AST
def note_invalid_subexpr_in_ice : Note<
"subexpression not valid in an integer constant expression">;
+// Driver
def pp_macro_not_used : Warning<"macro is not used">;
def err_pp_I_dash_not_supported : Error<
"-I- not supported, please use -iquote instead">;
-def warn_pp_undef_identifier : Warning<"%0 is not defined, evaluates to 0">;
+def warn_pp_undef_identifier : Warning<
+ "%0 is not defined, evaluates to 0">;
}
diff --git a/include/clang/Basic/DiagnosticDriverKinds.td b/include/clang/Basic/DiagnosticDriverKinds.td
index e375a70d31..37883a85ab 100644
--- a/include/clang/Basic/DiagnosticDriverKinds.td
+++ b/include/clang/Basic/DiagnosticDriverKinds.td
@@ -12,11 +12,17 @@ let Component = "Driver" in {
def err_drv_no_such_file : Error<"no such file or directory: '%0'">;
def err_drv_unsupported_opt : Error<"unsupported option '%0'">;
def err_drv_unknown_stdin_type : Error<
- "-E or -x required when input is from standard input">;
+ "-E or -x required when input is from standard input">;
def err_drv_unknown_language : Error<"language not recognized: '%0'">;
def err_drv_invalid_opt_with_multiple_archs : Error<
- "option '%0' cannot be used with multiple -arch options">;
+ "option '%0' cannot be used with multiple -arch options">;
def err_drv_invalid_output_with_multiple_archs : Error<
- "cannot use '%0' output with multiple -arch options">;
+ "cannot use '%0' output with multiple -arch options">;
+def err_drv_no_input_files : Error<"no input files">;
+def err_drv_use_of_Z_option : Error<
+ "unsupported use of internal gcc -Z option '%0'">;
+
+def warn_drv_input_file_unused : Warning<
+ "%0: '%1' input file unused when '%2' is present">;
}
diff --git a/include/clang/Basic/DiagnosticFrontendKinds.td b/include/clang/Basic/DiagnosticFrontendKinds.td
index b17d71b98b..2b7dcdfd6a 100644
--- a/include/clang/Basic/DiagnosticFrontendKinds.td
+++ b/include/clang/Basic/DiagnosticFrontendKinds.td
@@ -8,6 +8,10 @@
//===----------------------------------------------------------------------===//
let Component = "Frontend" in {
-def err_fe_error_reading : Error< "error reading '%0'">;
+
+def err_fe_unknown_triple : Error<
+ "unknown target triple '%0', please use -triple or -arch">;
+def err_fe_error_reading : Error<"error reading '%0'">;
def err_fe_error_reading_stdin : Error<"error reading stdin">;
+
}
diff --git a/include/clang/Basic/DiagnosticLexKinds.td b/include/clang/Basic/DiagnosticLexKinds.td
index 2db2b0f365..98f1be2fe4 100644
--- a/include/clang/Basic/DiagnosticLexKinds.td
+++ b/include/clang/Basic/DiagnosticLexKinds.td
@@ -22,6 +22,7 @@ def escaped_newline_block_comment_end : Warning<
def backslash_newline_space : Warning<
"backslash and newline separated by space">;
+// Trigraphs.
def trigraph_ignored : Warning<"trigraph ignored">;
def trigraph_ignored_block_comment : Warning<
"ignored trigraph would end block comment">;
@@ -46,6 +47,7 @@ def err_unterminated_block_comment : Error<"unterminated /* comment">;
def err_invalid_character_to_charify : Error<
"invalid argument to convert to character">;
+// Literal
def ext_nonstandard_escape : Extension<
"use of non-standard escape character '\\%0'">;
def ext_unknown_escape : Extension<"unknown escape sequence '\\%0'">;
@@ -67,12 +69,15 @@ def err_hexconstant_requires_exponent : Error<
"hexadecimal floating constants require an exponent">;
def ext_hexconstant_invalid : Extension<
"hexadecimal floating constants are a C99 feature">;
-def ext_binary_literal : Extension<"binary integer literals are an extension">;
+def ext_binary_literal : Extension<
+ "binary integer literals are an extension">;
def err_pascal_string_too_long : Error<"Pascal string is too long">;
def warn_octal_escape_too_large : ExtWarn<"octal escape sequence out of range">;
def warn_hex_escape_too_large : ExtWarn<"hex escape sequence out of range">;
-
+//===----------------------------------------------------------------------===//
+// Preprocessor Diagnostics
+//===----------------------------------------------------------------------===//
def pp_hash_warning : Warning<"#warning%0">;
def pp_include_next_in_primary : Warning<
"#include_next in primary source file">;
@@ -106,7 +111,7 @@ def ext_pp_extra_tokens_at_eol : Extension<
def ext_pp_comma_expr : Extension<"comma operator in operand of #if">;
def ext_pp_bad_vaargs_use : Extension<
"__VA_ARGS__ can only appear in the expansion of a C99 variadic macro">;
-def ext_pp_macro_redef : Extension<"%0 macro redefined">;
+def ext_pp_macro_redef : ExtWarn<"%0 macro redefined">;
def ext_variadic_macro : Extension<"variadic macros were introduced in C99">;
def ext_named_variadic_macro : Extension<
"named variadic macros are a GNU extension">;
diff --git a/include/clang/Basic/DiagnosticParseKinds.td b/include/clang/Basic/DiagnosticParseKinds.td
index fe38b6dbca..bc31c98761 100644
--- a/include/clang/Basic/DiagnosticParseKinds.td
+++ b/include/clang/Basic/DiagnosticParseKinds.td
@@ -46,7 +46,8 @@ def ext_c99_compound_literal : Extension<
def ext_c99_enumerator_list_comma : Extension<
"commas at the end of enumerator lists are a C99-specific feature">;
-def ext_gnu_indirect_goto : Extension<"use of GNU indirect-goto extension">;
+def ext_gnu_indirect_goto : Extension<
+ "use of GNU indirect-goto extension">;
def ext_gnu_address_of_label : Extension<
"use of GNU address-of-label extension">;
def ext_gnu_statement_expr : Extension<
@@ -63,6 +64,7 @@ def ext_gnu_old_style_field_designator : Extension<
"use of GNU old-style field designator extension">;
def ext_gnu_case_range : Extension<"use of GNU case range extension">;
+// Generic errors.
def err_parse_error : Error<"parse error">;
def err_expected_expression : Error<"expected expression">;
def err_expected_type : Error<"expected a type">;
@@ -80,6 +82,8 @@ def err_expected_semi_decl_list : Error<
"expected ';' at end of declaration list">;
def ext_expected_semi_decl_list : Extension<
"expected ';' at end of declaration list">;
+def err_expected_member_name_or_semi : Error<
+ "expected member name or ';' after declaration specifiers">;
def err_function_declared_typedef : Error<
"function definition declared 'typedef'">;
def err_expected_fn_body : Error<
@@ -99,6 +103,8 @@ def err_expected_semi_after : Error<"expected ';' after %0">;
def err_expected_semi_after_expr : Error<"expected ';' after expression">;
def err_expected_semi_after_method_proto : Error<
"expected ';' after method prototype">;
+def err_expected_semi_after_static_assert : Error<
+ "expected ';' after static_assert">;
def err_expected_semi_for : Error<"expected ';' in 'for' statement specifier">;
def err_expected_colon_after : Error<"expected ':' after %0">;
def err_label_end_of_compound_statement : Error<
@@ -124,6 +130,7 @@ def err_expected_class_name : Error<"expected class name">;
def err_unspecified_vla_size_with_static : Error<
"'static' may not be used with an unspecified variable length array size">;
+// Declarations.
def err_typename_requires_specqual : Error<
"type name requires a specifier or qualifier">;
def err_typename_invalid_storageclass : Error<
@@ -133,6 +140,7 @@ def err_typename_invalid_functionspec : Error<
def err_invalid_decl_spec_combination : Error<
"cannot combine with previous '%0' declaration specifier">;
+/// Objective-C parser diagnostics
def err_objc_no_attributes_on_category : Error<
"attributes may not be specified on a category">;
def err_objc_missing_end : Error<"missing @end">;
@@ -146,8 +154,7 @@ def err_objc_expected_equal : Error<
"setter/getter expects '=' followed by name">;
def err_objc_property_requires_field_name : Error<
"property requires fields to be named">;
-def err_objc_property_bitfield : Error<
- "property name cannot be a bitfield">;
+def err_objc_property_bitfield : Error<"property name cannot be a bitfield">;
def err_objc_expected_property_attr : Error<"unknown property attribute %0">;
def err_objc_propertoes_require_objc2 : Error<
"properties are an Objective-C 2 feature">;
@@ -175,6 +182,7 @@ def err_declaration_does_not_declare_param : Error<
"declaration does not declare a parameter">;
def err_no_matching_param : Error<"parameter named %0 is missing">;
+/// C++ parser diagnostics
def err_expected_unqualified_id : Error<"expected unqualified-id">;
def err_func_def_no_params : Error<
"function definition does not declare parameters">;
@@ -190,20 +198,28 @@ def ext_ellipsis_exception_spec : Extension<
"exception specification of '...' is a Microsoft extension">;
def err_expected_catch : Error<"expected catch">;
+// C++ derived classes
def err_dup_virtual : Error<"duplicate 'virtual' in base specifier">;
+// C++ operator overloading
def err_operator_missing_type_specifier : Error<
"missing type specifier after 'operator'">;
+// Classes.
def err_anon_type_definition : Error<
"declaration of anonymous %0 must be a definition">;
+
+/// C++ Templates
def err_expected_template : Error<"expected template">;
-def err_expected_comma_greater : Error<"expected ',' or '>' in template-parameter-list">;
+def err_expected_comma_greater : Error<
+ "expected ',' or '>' in template-parameter-list">;
def err_expected_type_id_after : Error<"expected type-id after '%0'">;
def err_expected_class_before : Error<"expected 'class' before '%0'">;
def 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">;
+ "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">;
def err_id_after_template_in_nested_name_spec : Error<
"expected template name after 'template' keyword in nested name specifier">;
def err_less_after_template_name_in_nested_name_spec : Error<
@@ -211,9 +227,12 @@ def err_less_after_template_name_in_nested_name_spec : Error<
def err_two_right_angle_brackets_need_space : Error<
"a space is required between consecutive right angle brackets (use '> >')">;
def warn_cxx0x_right_shift_in_template_arg : Warning<
- "use of right-shift operator ('>>') in template argument will require parentheses in C++0x">;
+ "use of right-shift operator ('>>') in template argument will require "
+ "parentheses in C++0x">;
+// Language specific pragmas
+// #pragma pack
def warn_pragma_pack_expected_lparen : Warning<
"missing '(' after '#pragma pack' - ignoring">;
def warn_pragma_pack_expected_rparen : Warning<
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td
index 4910616eea..dd2a17e791 100644
--- a/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/include/clang/Basic/DiagnosticSemaKinds.td
@@ -6,23 +6,31 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-//
+
+//===----------------------------------------------------------------------===//
// Semantic Analysis
-//
//===----------------------------------------------------------------------===//
let Component = "Sema" in {
+// Constant expressions
def err_expr_not_ice : Error<
"expression is not an integer constant expression">;
def ext_expr_not_ice : Extension<
- "expression is not integer constant expression (but is allowed as an extension)">;
+ "expression is not integer constant expression "
+ "(but is allowed as an extension)">;
+
def ext_null_pointer_expr_not_ice : Extension<
- "null pointer expression is not an integer constant expression (but is allowed as an extension)">;
+ "null pointer expression is not an integer constant expression "
+ "(but is allowed as an extension)">;
+
+
+// Semantic analysis of string and character constant literals.
def ext_predef_outside_function : Warning<
"predefined identifier is only valid inside function">;
+// C99 Designated Initializers
def err_array_designator_nonconstant : Error<
"array designator value must be a constant expression">;
def err_array_designator_negative : Error<
@@ -34,27 +42,32 @@ def err_array_designator_non_array : Error<
def err_array_designator_too_large : Error<
"array designator index (%0) exceeds array bounds (%1)">;
def err_field_designator_non_aggr : Error<
- "field designator cannot initialize a %select{non-struct, non-union|non-class}0 type %1">;
+ "field designator cannot initialize a "
+ "%select{non-struct, non-union|non-class}0 type %1">;
def err_field_designator_unknown : Error<
"field designator %0 does not refer to any field in type %1">;
def err_field_designator_nonfield : Error<
"field designator %0 does not refer to a non-static data member">;
def note_field_designator_found : Note<"field designator refers here">;
def err_field_designator_anon_class : Error<
- "field designator %0 refers to a member of an anonymous %select{struct|class|union}1">;
+ "field designator %0 refers to a member of an anonymous "
+ "%select{struct|class|union}1">;
def err_designator_for_scalar_init : Error<
"designator in initializer for scalar type %0">;
def warn_subobject_initializer_overrides : Warning<
- "subobject initialization overrides initialization of other fields within its enclosing subobject">;
+ "subobject initialization overrides initialization of other fields "
+ "within its enclosing subobject">;
def warn_initializer_overrides : Warning<
"initializer overrides prior initialization of this subobject">;
def note_previous_initializer : Note<
- "previous initialization %select{|with side effects }0is here%select{| (side effects may not occur at run time)}0">;
+ "previous initialization %select{|with side effects }0is here"
+ "%select{| (side effects may not occur at run time)}0">;
def err_designator_into_flexible_array_member : Error<
"designator into flexible array member subobject">;
def note_flexible_array_member : Note<
"initialized flexible array member %0 is here">;
+// Declarations.
def ext_vla : Extension<
"variable length arrays are a C99 feature, accepted as an extension">;
def ext_anon_param_requires_type_specifier : Extension<
@@ -73,10 +86,12 @@ def err_bad_language : Error<"unknown linkage language">;
def warn_use_out_of_scope_declaration : Warning<
"use of out-of-scope declaration of %0">;
+/// Built-in functions.
def ext_implicit_lib_function_decl : ExtWarn<
"implicitly declaring C library function '%0' with type %1">;
def note_please_include_header : Note<
- "please include the header <%0> or explicitly provide a declaration for '%1'">;
+ "please include the header <%0> or explicitly provide a "
+ "declaration for '%1'">;
def note_previous_builtin_declaration : Note<"%0 is a builtin with type %1">;
def err_implicit_decl_requires_stdio : Error<
"implicit declaration of '%0' requires inclusion of the header <stdio.h>">;
@@ -84,20 +99,24 @@ def warn_redecl_library_builtin : Warning<
"incompatible redeclaration of library function %0 will be ignored">;
def err_builtin_definition : Error<"definition of builtin function %0">;
+/// parser diagnostics
def ext_typedef_without_a_name : ExtWarn<"typedef requires a name">;
def err_statically_allocated_object : Error<
"Objective-C type cannot be statically allocated">;
def err_object_cannot_be_by_value : Error<
"Objective-C type cannot be %0 by value">;
def warn_enum_value_overflow : Warning<"overflow in enumeration value">;
-
def warn_pragma_pack_invalid_alignment : Warning<
"expected #pragma pack parameter to be '1', '2', '4', '8', or '16'">;
+// Follow the MSVC implementation.
def warn_pragma_pack_show : Warning<"value of #pragma pack(show) == %0">;
+// FIXME: Dehardcode.
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">;
+
+/// Objective-C parser diagnostics
def err_duplicate_class_def : Error<
"duplicate interface definition for class %0">;
def err_undef_superclass : Error<
@@ -106,10 +125,13 @@ def warn_previous_alias_decl : Warning<"previously declared alias is ignored">;
def err_conflicting_aliasing_type : Error<"conflicting types for alias %0">;
def warn_undef_interface : Warning<"cannot find interface declaration for %0">;
def err_duplicate_protocol_def : Error<"duplicate protocol definition of %0">;
+def err_protocol_has_circular_dependency : Error<
+ "protocol has circular dependency">;
def err_undeclared_protocol : Error<"cannot find protocol declaration for %0">;
def warn_undef_protocolref : Warning<"cannot find protocol definition for %0">;
def warn_readonly_property : Warning<
- "attribute 'readonly' of property %0 restricts attribute 'readwrite' of property inherited from %1">;
+ "attribute 'readonly' of property %0 restricts attribute "
+ "'readwrite' of property inherited from %1">;
def warn_property_attribute : Warning<
"property %0 '%1' attribute does not match the property inherited from %2">;
@@ -144,7 +166,8 @@ def err_objc_property_attr_mutually_exclusive : Error<
def err_objc_property_requires_object : Error<
"property with '%0' attribute must be of object type">;
def warn_objc_property_no_assignment_attribute : Warning<
- "no 'assign', 'retain', or 'copy' attribute is specified - 'assign' is assumed">;
+ "no 'assign', 'retain', or 'copy' attribute is specified - "
+ "'assign' is assumed">;
def warn_objc_property_default_assign_on_object : Warning<
"default property attribute 'assign' not appropriate for non-gc object">;
def warn_property_attr_mismatch : Warning<
@@ -166,7 +189,13 @@ def error_bad_category_property_decl : Error<
def error_bad_property_context : Error<
"property implementation must be in a class or category implementation">;
def error_missing_property_ivar_decl : Error<
- "synthesized property %0 must either be named the same as a compatible ivar or must explicitly name an ivar">;
+ "synthesized property %0 must either be named the same as a compatible"
+ " ivar or must explicitly name an ivar">;
+
+def error_synthesized_ivar_yet_not_supported : Error<
+ "instance variable synthesis not yet supported"
+ " (need to declare %0 explicitly)">;
+
def error_property_ivar_type : Error<
"type of property %0 does not match type of ivar %1">;
def error_weak_property : Error<
@@ -177,11 +206,20 @@ def error_dynamic_property_ivar_decl : Error<
"dynamic property can not have ivar specification">;
def error_duplicate_ivar_use : Error<
"synthesized properties %0 and %1 both claim ivar %2">;
-def error_property_implemented : Error<
- "property %0 is already implemented">;
+def error_property_implemented : Error<"property %0 is already implemented">;
def warn_objc_property_attr_mutually_exclusive : Warning<
"property attributes '%0' and '%1' are mutually exclusive">;
+// C++ declarations
+def err_static_assert_expression_is_not_constant : Error<
+ "static_assert expression is not an integral constant expression">;
+def err_static_assert_failed : Error<"static_assert failed \"%0\"">;
+
+// C++ name lookup
+def err_incomplete_nested_name_spec : Error<
+ "incomplete type %0 named in nested name specifier">;
+
+// C++ class members
def err_storageclass_invalid_for_member : Error<
"storage class specified for a member declaration">;
def err_mutable_function : Error<"'mutable' cannot be applied to functions">;
@@ -191,10 +229,14 @@ def err_mutable_nonmember : Error<
"'mutable' can only be applied to member variables">;
def err_virtual_non_function : Error<
"'virtual' can only appear on non-static member functions">;
-def err_not_bitfield_type : Error<"cannot declare %0 to be a bit-field type">;
+def err_virtual_out_of_class : Error<
+ "'virtual' can only be specified inside the class definition">;
def err_static_not_bitfield : Error<"static member %0 cannot be a bit-field">;
+def err_static_out_of_line : Error<
+ "'static' can not be specified on an out-of-line static member definition">;
+def err_typedef_not_bitfield : Error<"typedef member %0 cannot be a bit-field">;
def err_not_integral_type_bitfield : Error<
- "bit-field %0 with non-integral type">;
+ "bit-field %0 has non-integral type %1">;
def err_member_initialization : Error<
"%0 can only be initialized if it is a static const integral data member">;
def err_member_function_initialization : Error<
@@ -202,8 +244,10 @@ def err_member_function_initialization : Error<
def err_non_virtual_pure : Error<
"%0 is not virtual and cannot be declared pure">;
def err_implicit_object_parameter_init : Error<
- "cannot initialize object parameter of type %0 with an expression of type %1">;
+ "cannot initialize object parameter of type %0 with an expression "
+ "of type %1">;
+// C++ constructors
def err_constructor_cannot_be : Error<"constructor cannot be declared '%0'">;
def err_invalid_qualified_constructor : Error<
"'%0' qualifier is not allowed on a constructor">;
@@ -213,6 +257,7 @@ def err_constructor_redeclared : Error<"constructor cannot be redeclared">;
def err_constructor_byvalue_arg : Error<
"copy constructor must pass its first argument by reference">;
+// C++ destructors
def err_destructor_not_member : Error<
"destructor must be a non-static member function">;
def err_destructor_cannot_be : Error<"destructor cannot be declared '%0'">;
@@ -225,10 +270,14 @@ def err_destructor_variadic : Error<"destructor cannot be variadic">;
def err_destructor_typedef_name : Error<
"destructor cannot be declared using a typedef %0 of the class name">;
+// C++ initialization
+// FIXME: passing in an English string as %1!
def err_not_reference_to_const_init : Error<
"non-const reference to type %0 cannot be initialized with a %1 of type %2">;
+// FIXME: passing in an English string as %1!
def err_reference_init_drops_quals : Error<
- "initialization of reference to type %0 with a %1 of type %2 drops qualifiers">;
+ "initialization of reference to type %0 with a %1 of type %2 drops "
+ "qualifiers">;
def err_reference_var_requires_init : Error<
"declaration of reference variable %0 requires an initializer">;
def err_const_var_requires_init : Error<
@@ -240,11 +289,13 @@ def err_init_reference_member_uninitialized : Error<
def note_uninit_reference_member : Note<
"uninitialized reference member is here">;
+// Objective-C++
def err_objc_decls_may_only_appear_in_global_scope : Error<
"Objective-C declarations may only appear in global scope">;
def err_nsobject_attribute : Error<
"__attribute ((NSObject)) is for pointer types only">;
+// Attributes
def err_attribute_can_be_applied_only_to_symbol_declaration : Error<
"%0 attribute can be applied only to symbol declaration">;
def err_attributes_are_not_compatible : Error<
@@ -303,16 +354,22 @@ def warn_attribute_weak_on_field : Warning<
"__weak attribute cannot be specified on a field declaration">;
def warn_attribute_weak_on_local : Warning<
"__weak attribute cannot be specified on an automatic variable">;
+def warn_attribute_weak_import_invalid_on_definition : Warning<
+ "'weak_import' attribute cannot be specified on a definition">;
def warn_attribute_wrong_decl_type : Warning<
- "'%0' attribute only applies to %select{function|union|variable and function|function or method}1 types">;
+ "'%0' attribute only applies to %select{function|union|"
+ "variable and function|function or method}1 types">;
+
def warn_attribute_ignored_for_field_of_type : Warning<
"%0 attribute ignored for field of type %1">;
def warn_transparent_union_attribute_field_size : Warning<
- "transparent_union attribute ignored, size of type %0 must match type of first field">;
+ "transparent_union attribute ignored, size of type %0 must match "
+ "type of first field">;
def warn_transparent_union_attribute_not_difinition : Warning<
"transparent_union attribute ignored, union type must be defined">;
def warn_transparent_union_attribute_floating : Warning<
- "transparent_union attribute ignored, first field cannot be a floating-point or vector type">;
+ "transparent_union attribute ignored, first field cannot be a floating-point "
+ "or vector type">;
def warn_transparent_union_attribute_zero_fields : Warning<
"transparent_union attribute ignored, the union does not contain any fields">;
def warn_transparent_union_attribute_not_c : Warning<
@@ -331,7 +388,9 @@ def err_attr_wrong_decl : Error<
def warn_attribute_nonnull_no_pointers : Warning<
"'nonnull' attribute applied to function with no pointer arguments">;
def warn_transparent_union_nonpointer : Warning<
- "'transparent_union' attribute support incomplete; only supported for pointer unions">;
+ "'transparent_union' attribute support incomplete; only supported for "
+ "pointer unions">;
+
def warn_attribute_sentinel_not_variadic : Warning<
"'sentinel' attribute only supported for variadic functions">;
def err_attribute_sentinel_less_than_zero : Error<
@@ -345,19 +404,25 @@ def err_attribute_cleanup_arg_not_function : Error<
def err_attribute_cleanup_func_must_take_one_arg : Error<
"'cleanup' function %0 must take 1 parameter">;
def err_attribute_cleanup_func_arg_incompatible_type : Error<
- "'cleanup' function %0 parameter has type %1 which is incompatible with type %2">;
+ "'cleanup' function %0 parameter has type %1 which is incompatible with "
+ "type %2">;
+
+// Clang-Specific Attributes
def err_attribute_iboutlet : Error<
- "'iboutlet' attribute can only be applied to instance variables or properties">;
+ "'iboutlet' attribute can only be applied to instance variables or "
+ "properties">;
def err_attribute_overloadable_not_function : Error<
"'overloadable' attribute can only be applied to a function">;
def err_attribute_overloadable_missing : Error<
- "%select{overloaded function|redeclaration of}0 %1 must have the 'overloadable' attribute">;
+ "%select{overloaded function|redeclaration of}0 %1 must have the "
+ "'overloadable' attribute">;
def note_attribute_overloadable_prev_overload : Note<
"previous overload of function is here">;
def err_attribute_overloadable_no_prototype : Error<
"'overloadable' function %0 must have a prototype">;
+// Function Parameter Semantic Analysis.
def err_param_with_void_type : Error<"argument may not have 'void' type">;
def err_void_only_param : Error<
"'void' must be the first and only parameter if specified">;
@@ -369,7 +434,8 @@ def ext_param_not_declared : Extension<
"parameter %0 was not declared, defaulting to type 'int'">;
def ext_param_typedef_of_void : Extension<
"empty parameter list defined with a typedef of 'void' not allowed in C++">;
-def err_param_default_argument : Error<"C does not support default arguments">;
+def err_param_default_argument : Error<
+ "C does not support default arguments">;
def err_param_default_argument_redefinition : Error<
"redefinition of default argument">;
def err_param_default_argument_missing : Error<
@@ -383,17 +449,27 @@ def err_param_default_argument_references_local : Error<
def err_param_default_argument_references_this : Error<
"default argument references 'this'">;
def err_param_default_argument_nonfunc : Error<
- "default arguments can only be specified for parameters in a function declaration">;
+ "default arguments can only be specified for parameters in a function "
+ "declaration">;
+def ext_param_promoted_not_compatible_with_prototype : ExtWarn<
+ "promoted type %0 of K&R function parameter is not compatible with the "
+ "parameter type %1 declared in a previous prototype">;
+
+
+// C++ Overloading Semantic Analysis.
def err_ovl_diff_return_type : Error<
"functions that differ only in their return type cannot be overloaded">;
def err_ovl_static_nonstatic_member : Error<
- "static and non-static member functions with the same parameter types cannot be overloaded">;
+ "static and non-static member functions with the same parameter types "
+ "cannot be overloaded">;
+
def err_ovl_no_viable_function_in_call : Error<
"no matching function for call to %0">;
def err_ovl_no_viable_member_function_in_call : Error<
"no matching member function for call to %0">;
-def err_ovl_ambiguous_call : Error<"call to %0 is ambiguous">;
+def err_ovl_ambiguous_call : Error<
+ "call to %0 is ambiguous">;
def err_ovl_deleted_call : Error<
"call to %select{unavailable|deleted}0 function %1">;
def err_ovl_ambiguous_member_call : Error<
@@ -425,4 +501,959 @@ def err_ovl_surrogate_cand : Note<"conversion candidate of type %0">;
def err_member_call_without_object : Error<
"call to non-static member function without an object argument">;
+// C++ Template Declarations
+def err_template_param_shadow : Error<
+ "declaration of %0 shadows template parameter">;
+def note_template_param_here : Note<"template parameter is declared here">;
+def note_template_export_unsupported : Note<
+ "exported templates are unsupported">;
+def err_template_outside_namespace_or_class_scope : Error<
+ "templates can only be declared in namespace or class scope">;
+def err_template_linkage : Error<"templates must have C++ linkage">;
+def err_template_unnamed_class : Error<
+ "cannot declare a class template with no name">;
+def err_template_param_list_different_arity : Error<
+ "%select{too few|too many}0 template parameters in template "
+ "%select{|template parameter }1redeclaration">;
+def note_template_param_list_different_arity : Note<
+ "%select{too few|too many}0 template parameters in template template "
+ "argument">;
+def note_template_prev_declaration : Note<
+ "previous template %select{declaration|template parameter}0 is here">;
+def err_template_param_different_kind : Error<
+ "template parameter has a different kind in template "
+ "%select{|template parameter }0redeclaration">;
+def note_template_param_different_kind : Note<
+ "template parameter has a different kind in template argument">;
+def err_template_nontype_parm_different_type : Error<
+ "template non-type parameter has a different type %0 in template "
+ "%select{|template parameter }1redeclaration">;
+
+def note_template_nontype_parm_different_type : Note<
+ "template non-type parameter has a different type %0 in template argument">;
+def note_template_nontype_parm_prev_declaration : Note<
+ "previous non-type template parameter with type %0 is here">;
+def err_template_nontype_parm_bad_type : Error<
+ "a non-type template parameter cannot have type %0">;
+def err_template_param_default_arg_redefinition : Error<
+ "template parameter redefines default argument">;
+def note_template_param_prev_default_arg : Note<
+ "previous default template argument defined here">;
+def err_template_param_default_arg_missing : Error<
+ "template parameter missing a default argument">;
+
+// C++ Template Argument Lists
+def err_template_arg_list_different_arity : Error<
+ "%select{too few|too many}0 template arguments for "
+ "%select{class template|function template|template template parameter"
+ "|template}1 %2">;
+
+
+def note_template_decl_here : Note<"template is declared here">;
+def err_template_arg_must_be_type : Error<
+ "template argument for template type parameter must be a type">;
+def err_template_arg_must_be_expr : Error<
+ "template argument for non-type template parameter must be an expression">;
+def err_template_arg_nontype_ambig : Error<
+ "template argument for non-type template parameter is treated as type %0">;
+def err_template_arg_must_be_template : Error<
+ "template argument for template template parameter must be a template">;
+def err_template_arg_local_type : Error<"template argument uses local type %0">;
+def err_template_arg_unnamed_type : Error<
+ "template argument uses unnamed type">;
+def note_template_unnamed_type_here : Note<
+ "unnamed type used in template argument was declared here">;
+def err_template_arg_not_class_template : Error<
+ "template argument does not refer to a class template">;
+def note_template_arg_refers_here_func : Note<
+ "template argument refers to function template %0, here">;
+def err_template