aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic/DiagnosticSemaKinds.td
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Basic/DiagnosticSemaKinds.td')
-rw-r--r--include/clang/Basic/DiagnosticSemaKinds.td297
1 files changed, 243 insertions, 54 deletions
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td
index c7cd205b54..f5345eb8c3 100644
--- a/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/include/clang/Basic/DiagnosticSemaKinds.td
@@ -78,6 +78,9 @@ def ext_vla : Extension<"variable length arrays are a C99 feature">,
InGroup<VLAExtension>;
def warn_vla_used : Warning<"variable length array used">,
InGroup<VLA>, DefaultIgnore;
+def warn_cxx11_compat_array_of_runtime_bound : Warning<
+ "arrays of runtime bound are incompatible with C++ standards before C++1y">,
+ InGroup<CXXPre1yCompatPedantic>, DefaultIgnore;
def err_vla_non_pod : Error<"variable length array of non-POD element type %0">;
def err_vla_in_sfinae : Error<
"variable length array cannot be formed during template argument deduction">;
@@ -254,19 +257,20 @@ def note_using_decl_constructor_conflict_previous_ctor : Note<
"previous constructor">;
def note_using_decl_constructor_conflict_previous_using : Note<
"previously inherited here">;
+def warn_using_decl_constructor_ellipsis : Warning<
+ "inheriting constructor does not inherit ellipsis">,
+ InGroup<DiagGroup<"inherited-variadic-ctor">>;
+def note_using_decl_constructor_ellipsis : Note<
+ "constructor declared with ellipsis here">;
def err_using_decl_can_not_refer_to_class_member : Error<
"using declaration can not refer to class member">;
def err_using_decl_can_not_refer_to_namespace : Error<
"using declaration can not refer to namespace">;
def err_using_decl_constructor : Error<
"using declaration can not refer to a constructor">;
-def err_using_decl_constructor_unsupported : Error<
- "inheriting constructors are not supported">;
-// FIXME: Replace the above error with this warning if support for
-// inheriting constructors is implemented.
-//def warn_cxx98_compat_using_decl_constructor : Warning<
-// "inheriting constructors are incompatible with C++98">,
-// InGroup<CXX98Compat>, DefaultIgnore;
+def warn_cxx98_compat_using_decl_constructor : Warning<
+ "inheriting constructors are incompatible with C++98">,
+ InGroup<CXX98Compat>, DefaultIgnore;
def err_using_decl_destructor : Error<
"using declaration can not refer to a destructor">;
def err_using_decl_template_id : Error<
@@ -295,9 +299,9 @@ def warn_exit_time_destructor : Warning<
InGroup<ExitTimeDestructors>, DefaultIgnore;
def err_invalid_thread : Error<
- "'__thread' is only allowed on variable declarations">;
+ "'%0' is only allowed on variable declarations">;
def err_thread_non_global : Error<
- "'__thread' variables must have global storage">;
+ "'%0' variables must have global storage">;
def err_thread_unsupported : Error<
"thread-local storage is unsupported for the current target">;
@@ -410,6 +414,8 @@ def err_main_arg_wrong : Error<"%select{first|second|third|fourth}0 "
"platform-specific data}0) must be of type %1">;
/// parser diagnostics
+def ext_no_declarators : ExtWarn<"declaration does not declare anything">,
+ InGroup<MissingDeclarations>;
def ext_typedef_without_a_name : ExtWarn<"typedef requires a name">,
InGroup<MissingDeclarations>;
def err_typedef_not_identifier : Error<"typedef name must be an identifier">;
@@ -522,9 +528,8 @@ def err_conflicting_ivar_name : Error<
"conflicting instance variable names: %0 vs %1">;
def err_inconsistant_ivar_count : Error<
"inconsistent number of instance variables specified">;
-def warn_incomplete_impl : Warning<"incomplete implementation">,
+def warn_undef_method_impl : Warning<"method definition for %0 not found">,
InGroup<DiagGroup<"incomplete-implementation">>;
-def note_undef_method_impl : Note<"method definition for %0 not found">;
def note_required_for_protocol_at :
Note<"required for direct or indirect protocol %0">;
@@ -632,9 +637,15 @@ def warn_objc_property_no_assignment_attribute : Warning<
"'assign' is assumed">,
InGroup<ObjCPropertyNoAttribute>;
def warn_objc_isa_use : Warning<
- "direct access to Objective-C's isa is deprecated "
- "in favor of object_setClass() and object_getClass()">,
- InGroup<DiagGroup<"deprecated-objc-isa-usage">>;
+ "direct access to Objective-C's isa is deprecated in favor of "
+ "object_getClass()">, InGroup<DeprecatedObjCIsaUsage>;
+def warn_objc_isa_assign : Warning<
+ "assignment to Objective-C's isa is deprecated in favor of "
+ "object_setClass()">, InGroup<DeprecatedObjCIsaUsage>;
+def warn_objc_pointer_masking : Warning<
+ "bitmasking for introspection of Objective-C object pointers is strongly "
+ "discouraged">,
+ InGroup<DiagGroup<"deprecated-objc-pointer-introspection">>;
def warn_objc_property_default_assign_on_object : Warning<
"default property attribute 'assign' not appropriate for non-GC object">,
InGroup<ObjCPropertyNoAttribute>;
@@ -666,6 +677,15 @@ def warn_auto_synthesizing_protocol_property :Warning<
"auto property synthesis will not synthesize property"
" declared in a protocol">,
InGroup<DiagGroup<"objc-protocol-property-synthesis">>;
+def warn_no_autosynthesis_shared_ivar_property : Warning <
+ "auto property synthesis will not synthesize property "
+ "'%0' because it cannot share an ivar with another synthesized property">,
+ InGroup<ObjCNoPropertyAutoSynthesis>;
+def warn_no_autosynthesis_property : Warning<
+ "auto property synthesis will not synthesize property "
+ "'%0' because it is 'readwrite' but it will be synthesized 'readonly' "
+ "via another property">,
+ InGroup<ObjCNoPropertyAutoSynthesis>;
def warn_autosynthesis_property_ivar_match :Warning<
"autosynthesized property %0 will use %select{|synthesized}1 instance variable "
"%2, not existing instance variable %3">,
@@ -854,6 +874,8 @@ def err_friend_def_in_local_class : Error<
"friend function cannot be defined in a local class">;
def err_friend_not_first_in_declaration : Error<
"'friend' must appear first in a non-function declaration">;
+def err_using_decl_friend : Error<
+ "cannot befriend target of using declaration">;
def err_invalid_member_in_interface : Error<
"%select{data member |non-public member function |static member function |"
@@ -1095,9 +1117,11 @@ def note_member_synthesized_at : Note<
"implicit default %select{constructor|copy constructor|move constructor|copy "
"assignment operator|move assignment operator|destructor}0 for %1 first "
"required here">;
+def note_inhctor_synthesized_at : Note<
+ "inheriting constructor for %0 first required here">;
def err_missing_default_ctor : Error<
- "%select{|implicit default }0constructor for %1 must explicitly initialize "
- "the %select{base class|member}2 %3 which does not have a default "
+ "%select{|implicit default |inheriting }0constructor for %1 must explicitly "
+ "initialize the %select{base class|member}2 %3 which does not have a default "
"constructor">;
def err_illegal_union_or_anon_struct_member : Error<
@@ -1151,8 +1175,7 @@ def warn_cxx98_compat_static_data_member_in_union : Warning<
def err_union_member_of_reference_type : Error<
"union member %0 has reference type %1">;
def ext_anonymous_struct_union_qualified : Extension<
- "anonymous %select{struct|union}0 cannot be '%select{const|volatile|"
- "restrict}1'">;
+ "anonymous %select{struct|union}0 cannot be '%1'">;
def err_different_return_type_for_overriding_virtual_function : Error<
"virtual function %0 has a different return type "
"%diff{($) than the function it overrides (which has return type $)|"
@@ -1284,7 +1307,8 @@ def err_member_function_call_bad_cvr : Error<"member function %0 not viable: "
"volatile or restrict|const, volatile, or restrict}2">;
def err_reference_bind_to_bitfield : Error<
- "%select{non-const|volatile}0 reference cannot bind to bit-field %1">;
+ "%select{non-const|volatile}0 reference cannot bind to "
+ "bit-field%select{| %1}2">;
def err_reference_bind_to_vector_element : Error<
"%select{non-const|volatile}0 reference cannot bind to vector element">;
def err_reference_var_requires_init : Error<
@@ -1405,7 +1429,7 @@ def err_auto_not_allowed : Error<
"|in non-static union member|in non-static class member|in interface member"
"|in exception declaration|in template parameter|in block literal"
"|in template argument|in typedef|in type alias|in function return type"
- "|here}0">;
+ "|in conversion function type|here}0">;
def err_auto_var_requires_init : Error<
"declaration of variable %0 with type %1 requires an initializer">;
def err_auto_new_requires_ctor_arg : Error<
@@ -1431,7 +1455,8 @@ def err_auto_var_deduction_failure_from_init_list : Error<
def err_auto_new_deduction_failure : Error<
"new expression for type %0 has incompatible constructor argument of type %1">;
def err_auto_different_deductions : Error<
- "'auto' deduced as %0 in declaration of %1 and deduced as %2 in declaration of %3">;
+ "'%select{auto|decltype(auto)}0' deduced as %1 in declaration of %2 and "
+ "deduced as %3 in declaration of %4">;
def err_implied_std_initializer_list_not_found : Error<
"cannot deduce type of initializer list because std::initializer_list was "
"not found; include <initializer_list>">;
@@ -1442,6 +1467,34 @@ def warn_dangling_std_initializer_list : Warning<
"%select{the full-expression|the constructor}0">,
InGroup<DiagGroup<"dangling-initializer-list">>;
+// C++1y decltype(auto) type
+def err_decltype_auto_cannot_be_combined : Error<
+ "'decltype(auto)' cannot be combined with other type specifiers">;
+def err_decltype_auto_function_declarator_not_declaration : Error<
+ "'decltype(auto)' can only be used as a return type "
+ "in a function declaration">;
+def err_decltype_auto_compound_type : Error<
+ "cannot form %select{pointer to|reference to|array of}0 'decltype(auto)'">;
+def err_decltype_auto_initializer_list : Error<
+ "cannot deduce 'decltype(auto)' from initializer list">;
+
+// C++1y deduced return types
+def err_auto_fn_deduction_failure : Error<
+ "cannot deduce return type %0 from returned value of type %1">;
+def err_auto_fn_different_deductions : Error<
+ "'%select{auto|decltype(auto)}0' in return type deduced as %1 here but "
+ "deduced as %2 in earlier return statement">;
+def err_auto_fn_used_before_defined : Error<
+ "function %0 with deduced return type cannot be used before it is defined">;
+def err_auto_fn_no_return_but_not_auto : Error<
+ "cannot deduce return type %0 for function with no return statements">;
+def err_auto_fn_return_void_but_not_auto : Error<
+ "cannot deduce return type %0 from omitted return expression">;
+def err_auto_fn_return_init_list : Error<
+ "cannot deduce return type from initializer list">;
+def err_auto_fn_virtual : Error<
+ "function with deduced return type cannot be virtual">;
+
// C++11 override control
def override_keyword_only_allowed_on_virtual_member_functions : Error<
"only virtual member functions can be marked '%0'">;
@@ -1531,6 +1584,11 @@ def note_for_range_begin_end : Note<
def warn_cxx98_compat_constexpr : Warning<
"'constexpr' specifier is incompatible with C++98">,
InGroup<CXX98Compat>, DefaultIgnore;
+// FIXME: Maybe this should also go in -Wc++1y-compat?
+def warn_cxx1y_compat_constexpr_not_const : Warning<
+ "'constexpr' non-static member function will not be implicitly 'const' "
+ "in C++1y; add 'const' to avoid a change in behavior">,
+ InGroup<DiagGroup<"constexpr-not-const">>;
def err_invalid_constexpr : Error<
"%select{function parameter|typedef|non-static data member}0 "
"cannot be constexpr">;
@@ -1569,20 +1627,54 @@ def err_constexpr_non_literal_param : Error<
"not a literal type">;
def err_constexpr_body_invalid_stmt : Error<
"statement not allowed in constexpr %select{function|constructor}0">;
-def err_constexpr_type_definition : Error<
- "types cannot be defined in a constexpr %select{function|constructor}0">;
+def ext_constexpr_body_invalid_stmt : ExtWarn<
+ "use of this statement in a constexpr %select{function|constructor}0 "
+ "is a C++1y extension">, InGroup<CXX1y>;
+def warn_cxx11_compat_constexpr_body_invalid_stmt : Warning<
+ "use of this statement in a constexpr %select{function|constructor}0 "
+ "is incompatible with C++ standards before C++1y">,
+ InGroup<CXXPre1yCompat>, DefaultIgnore;
+def ext_constexpr_type_definition : ExtWarn<
+ "type definition in a constexpr %select{function|constructor}0 "
+ "is a C++1y extension">, InGroup<CXX1y>;
+def warn_cxx11_compat_constexpr_type_definition : Warning<
+ "type definition in a constexpr %select{function|constructor}0 "
+ "is incompatible with C++ standards before C++1y">,
+ InGroup<CXXPre1yCompat>, DefaultIgnore;
def err_constexpr_vla : Error<
"variably-modified type %0 cannot be used in a constexpr "
"%select{function|constructor}1">;
-def err_constexpr_var_declaration : Error<
- "variables cannot be declared in a constexpr %select{function|constructor}0">;
+def ext_constexpr_local_var : ExtWarn<
+ "variable declaration in a constexpr %select{function|constructor}0 "
+ "is a C++1y extension">, InGroup<CXX1y>;
+def warn_cxx11_compat_constexpr_local_var : Warning<
+ "variable declaration in a constexpr %select{function|constructor}0 "
+ "is incompatible with C++ standards before C++1y">,
+ InGroup<CXXPre1yCompat>, DefaultIgnore;
+def err_constexpr_local_var_static : Error<
+ "%select{static|thread_local}1 variable not permitted in a constexpr "
+ "%select{function|constructor}0">;
+def err_constexpr_local_var_non_literal_type : Error<
+ "variable of non-literal type %1 cannot be defined in a constexpr "
+ "%select{function|constructor}0">;
+def err_constexpr_local_var_no_init : Error<
+ "variables defined in a constexpr %select{function|constructor}0 must be "
+ "initialized">;
def ext_constexpr_function_never_constant_expr : ExtWarn<
"constexpr %select{function|constructor}0 never produces a "
"constant expression">, InGroup<DiagGroup<"invalid-constexpr">>, DefaultError;
def err_constexpr_body_no_return : Error<
"no return statement in constexpr function">;
-def err_constexpr_body_multiple_return : Error<
- "multiple return statements in constexpr function">;
+def warn_cxx11_compat_constexpr_body_no_return : Warning<
+ "constexpr function with no return statements is incompatible with C++ "
+ "standards before C++1y">, InGroup<CXXPre1yCompat>, DefaultIgnore;
+def ext_constexpr_body_multiple_return : ExtWarn<
+ "multiple return statements in constexpr function is a C++1y extension">,
+ InGroup<CXX1y>;
+def warn_cxx11_compat_constexpr_body_multiple_return : Warning<
+ "multiple return statements in constexpr function "
+ "is incompatible with C++ standards before C++1y">,
+ InGroup<CXXPre1yCompat>, DefaultIgnore;
def note_constexpr_body_previous_return : Note<
"previous return statement is here">;
def err_constexpr_function_try_block : Error<
@@ -1794,6 +1886,19 @@ def err_attribute_section_local_variable : Error<
def warn_mismatched_section : Warning<
"section does not match previous declaration">, InGroup<Section>;
+def err_anonymous_property: Error<
+ "anonymous property is not supported">;
+def err_property_is_variably_modified: Error<
+ "property '%0' has a variably modified type">;
+def err_no_getter_for_property : Error<
+ "no getter defined for property '%0'">;
+def err_no_setter_for_property : Error<
+ "no setter defined for property '%0'">;
+def error_cannot_find_suitable_getter : Error<
+ "cannot find suitable getter for property '%0'">;
+def error_cannot_find_suitable_setter : Error<
+ "cannot find suitable setter for property '%0'">;
+
def err_attribute_aligned_not_power_of_two : Error<
"requested alignment is not a power of 2">;
def err_attribute_aligned_greater_than_8192 : Error<
@@ -2072,7 +2177,7 @@ def warn_impcast_integer_precision_constant : Warning<
InGroup<ConstantConversion>;
def warn_impcast_bitfield_precision_constant : Warning<
"implicit truncation from %2 to bitfield changes value from %0 to %1">,
- InGroup<ConstantConversion>;
+ InGroup<BitFieldConstantConversion>;
def warn_impcast_literal_float_to_integer : Warning<
"implicit conversion from %0 to %1 changes value from %2 to %3">,
InGroup<LiteralConversion>;
@@ -2141,6 +2246,8 @@ def warn_attribute_protected_visibility :
Warning<"target does not support 'protected' visibility; using 'default'">,
InGroup<DiagGroup<"unsupported-visibility">>;
def err_mismatched_visibility: Error<"visibility does not match previous declaration">;
+def warn_attribute_unknown_endian : Warning<"unknown endian '%0'">,
+ InGroup<IgnoredAttributes>;
def note_previous_attribute : Note<"previous attribute is here">;
def err_unknown_machine_mode : Error<"unknown machine mode %0">;
def err_unsupported_machine_mode : Error<"unsupported machine mode %0">;
@@ -2263,8 +2370,8 @@ def err_uninitialized_member_for_assign : Error<
"non-static %select{reference|const}1 member %2 can't use default "
"assignment operator">;
def err_uninitialized_member_in_ctor : Error<
- "%select{|implicit default }0constructor for %1 must explicitly initialize "
- "the %select{reference|const}2 member %3">;
+ "%select{|implicit default |inheriting }0constructor for %1 must explicitly "
+ "initialize the %select{reference|const}2 member %3">;
def err_default_arg_makes_ctor_special : Error<
"addition of default argument on redeclaration makes this constructor a "
"%select{default|copy|move}0 constructor">;
@@ -2352,6 +2459,11 @@ def note_ovl_candidate_failed_overload_resolution : Note<
"function %0">;
def note_ovl_candidate_non_deduced_mismatch : Note<
"candidate template ignored: could not match %diff{$ against $|types}0,1">;
+// This note is needed because the above note would sometimes print two
+// different types with the same name. Remove this note when the above note
+// can handle that case properly.
+def note_ovl_candidate_non_deduced_mismatch_qualified : Note<
+ "candidate template ignored: could not match %q0 against %q1">;
// Note that we don't treat templates differently for this diagnostic.
def note_ovl_candidate_arity : Note<"candidate "
@@ -3312,6 +3424,9 @@ def warn_internal_in_extern_inline : ExtWarn<
def ext_internal_in_extern_inline : Extension<
"static %select{function|variable}0 %1 is used in an inline function with "
"external linkage">, InGroup<StaticInInline>;
+def warn_static_local_in_extern_inline : Warning<
+ "non-constant static local variable in inline function may be different "
+ "in different files">, InGroup<StaticLocalInInline>;
def note_convert_inline_to_static : Note<
"use 'static' to give inline function %0 internal linkage">;
def note_internal_decl_declared_here : Note<
@@ -3343,6 +3458,9 @@ def err_non_thread_thread : Error<
"non-thread-local declaration of %0 follows thread-local declaration">;
def err_thread_non_thread : Error<
"thread-local declaration of %0 follows non-thread-local declaration">;
+def err_thread_thread_different_kind : Error<
+ "thread-local declaration of %0 with %select{static|dynamic}1 initialization "
+ "follows declaration with %select{dynamic|static}1 initialization">;
def err_redefinition_different_type : Error<
"redefinition of %0 with a different type%diff{: $ vs $|}1,2">;
def err_redefinition_different_kind : Error<
@@ -3701,8 +3819,10 @@ def err_arc_unsupported_weak_class : Error<
def err_arc_weak_unavailable_assign : Error<
"assignment of a weak-unavailable object to a __weak object">;
def err_arc_weak_unavailable_property : Error<
- "synthesis of a weak-unavailable property is disallowed "
- "because it requires synthesis of an instance variable of the __weak object">;
+ "synthesizing __weak instance variable of type %0, which does not "
+ "support weak references">;
+def note_implemented_by_class : Note<
+ "when implemented by class %0">;
def err_arc_convesion_of_weak_unavailable : Error<
"%select{implicit conversion|cast}0 of weak-unavailable object of type %1 to"
" a __weak object of type %2">;
@@ -3924,16 +4044,19 @@ def err_atomic_specifier_bad_type : Error<
"%1 %select{||||||which is not trivially copyable}0">;
// Expressions.
-def ext_sizeof_function_type : Extension<
- "invalid application of 'sizeof' to a function type">, InGroup<PointerArith>;
-def ext_sizeof_void_type : Extension<
- "invalid application of '%select{sizeof|__alignof|vec_step}0' to a void "
+def ext_sizeof_alignof_function_type : Extension<
+ "invalid application of '%select{sizeof|alignof|vec_step}0' to a "
+ "function type">, InGroup<PointerArith>;
+def ext_sizeof_alignof_void_type : Extension<
+ "invalid application of '%select{sizeof|alignof|vec_step}0' to a void "
"type">, InGroup<PointerArith>;
def err_sizeof_alignof_incomplete_type : Error<
- "invalid application of '%select{sizeof|__alignof|vec_step}0' to an "
+ "invalid application of '%select{sizeof|alignof|vec_step}0' to an "
"incomplete type %1">;
def err_sizeof_alignof_bitfield : Error<
- "invalid application of '%select{sizeof|__alignof}0' to bit-field">;
+ "invalid application of '%select{sizeof|alignof}0' to bit-field">;
+def err_alignof_member_of_incomplete_type : Error<
+ "invalid application of 'alignof' to a field of a class still being defined">;
def err_vecstep_non_scalar_vector_type : Error<
"'vec_step' requires built-in scalar or vector type, %0 invalid">;
def err_offsetof_incomplete_type : Error<
@@ -3998,6 +4121,13 @@ def warn_bitwise_and_in_bitwise_or : Warning<
def warn_logical_and_in_logical_or : Warning<
"'&&' within '||'">, InGroup<LogicalOpParentheses>;
+def warn_overloaded_shift_in_comparison :Warning<
+ "overloaded operator %select{>>|<<}0 has lower precedence than "
+ "comparison operator">,
+ InGroup<OverloadedShiftOpParentheses>;
+def note_evaluate_comparison_first :Note<
+ "place parentheses around comparison expression to evaluate it first">;
+
def warn_addition_in_bitshift : Warning<
"operator '%0' has lower precedence than '%1'; "
"'%1' will be evaluated first">, InGroup<ShiftOpParentheses>;
@@ -4016,6 +4146,10 @@ def warn_sizeof_array_param : Warning<
"sizeof on array function parameter will return size of %0 instead of %1">,
InGroup<SizeofArrayArgument>;
+def warn_sizeof_array_decay : Warning<
+ "sizeof on pointer operation will return size of %0 instead of %1">,
+ InGroup<SizeofArrayDecay>;
+
def err_sizeof_nonfragile_interface : Error<
"application of '%select{alignof|sizeof}1' to interface %0 is "
"not supported on this architecture and platform">;
@@ -4040,6 +4174,8 @@ def err_subscript_function_type : Error<
"subscript of pointer to function type %0">;
def err_subscript_incomplete_type : Error<
"subscript of pointer to incomplete type %0">;
+def err_dereference_incomplete_type : Error<
+ "dereference of pointer to incomplete type %0">;
def ext_gnu_subscript_void_type : Extension<
"subscript of a pointer to void is a GNU extension">, InGroup<PointerArith>;
def err_typecheck_member_reference_struct_union : Error<
@@ -4166,7 +4302,13 @@ def err_typecheck_sclass_fscope : Error<
"illegal storage class on file-scoped variable">;
def err_unsupported_global_register : Error<
"global register variables are not supported">;
-def warn_standalone_specifier : Warning<"'%0' ignored on this declaration">;
+def warn_standalone_specifier : Warning<"'%0' ignored on this declaration">,
+ InGroup<MissingDeclarations>;
+def ext_standalone_specifier : ExtWarn<"'%0' is not permitted on a declaration "
+ "of a type">, InGroup<MissingDeclarations>;
+def err_standalone_class_nested_name_specifier : Error<
+ "forward declaration of %select{class|struct|interface|union|enum}0 cannot "
+ "have a nested name specifier">;
def err_typecheck_sclass_func : Error<"illegal storage class on function">;
def err_static_block_func : Error<
"function declared in block scope cannot have 'static' storage class">;
@@ -4434,8 +4576,7 @@ def err_catch_param_not_objc_type : Error<
def err_illegal_qualifiers_on_catch_parm : Error<
"illegal qualifiers on @catch parameter">;
def err_storage_spec_on_catch_parm : Error<
- "@catch parameter cannot have storage specifier %select{|'typedef'|'extern'|"
- "'static'|'auto'|'register'|'__private_extern__'|'mutable'}0">;
+ "@catch parameter cannot have storage specifier '%0'">;
def warn_register_objc_catch_parm : Warning<
"'register' storage specifier on @catch parameter will be ignored">;
def err_qualified_objc_catch_parm : Error<
@@ -4468,6 +4609,14 @@ def note_parameter_here : Note<
def err_bad_reinterpret_cast_overload : Error<
"reinterpret_cast cannot resolve overloaded function %0 to type %1">;
+def warn_reinterpret_different_from_static : Warning<
+ "'reinterpret_cast' %select{from|to}3 class %0 %select{to|from}3 its "
+ "%select{virtual base|base at non-zero offset}2 %1 behaves differently from "
+ "'static_cast'">, InGroup<ReinterpretBaseClass>;
+def note_reinterpret_updowncast_use_static: Note<
+ "use 'static_cast' to adjust the pointer correctly while "
+ "%select{upcasting|downcasting}0">;
+
def err_bad_static_cast_overload : Error<
"address of overloaded function %0 cannot be static_cast to type %1">;
@@ -4481,6 +4630,9 @@ def err_bad_cxx_cast_generic : Error<
def err_bad_cxx_cast_rvalue : Error<
"%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
"functional-style cast}0 from rvalue to reference type %2">;
+def err_bad_cxx_cast_bitfield : Error<
+ "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
+ "functional-style cast}0 from bit-field lvalue to reference type %2">;
def err_bad_cxx_cast_qualifiers_away : Error<
"%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
"functional-style cast}0 from %1 to %2 casts away qualifiers">;
@@ -4644,7 +4796,16 @@ def warn_overloaded_virtual : Warning<
"%q0 hides overloaded virtual %select{function|functions}1">,
InGroup<OverloadedVirtual>, DefaultIgnore;
def note_hidden_overloaded_virtual_declared_here : Note<
- "hidden overloaded virtual function %q0 declared here">;
+ "hidden overloaded virtual function %q0 declared here"
+ "%select{|: different classes%diff{ ($ vs $)|}2,3"
+ "|: different number of parameters (%2 vs %3)"
+ "|: type mismatch at %ordinal2 parameter%diff{ ($ vs $)|}3,4"
+ "|: different return type%diff{ ($ vs $)|}2,3"
+ "|: different qualifiers ("
+ "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
+ "volatile and restrict|const, volatile, and restrict}2 vs "
+ "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
+ "volatile and restrict|const, volatile, and restrict}3)}1">;
def warn_using_directive_in_header : Warning<
"using namespace directive in global context in header">,
InGroup<HeaderHygiene>, DefaultIgnore;
@@ -4711,9 +4872,6 @@ let CategoryName = "Lambda Issue" in {
"incomplete result type %0 in lambda expression">;
def err_lambda_objc_object_result : Error<
"non-pointer Objective-C class type %0 in lambda expression result">;
- def ext_lambda_default_arguments : ExtWarn<
- "C++11 forbids default arguments for lambda expressions">,
- InGroup<LambdaExtensions>;
def err_noreturn_lambda_has_return_expr : Error<
"lambda declared 'noreturn' should not return">;
def warn_maybe_falloff_nonvoid_lambda : Warning<
@@ -4733,6 +4891,9 @@ let CategoryName = "Lambda Issue" in {
"here">;
}
+def err_return_in_captured_stmt : Error<
+ "cannot return from %0">;
+
def err_operator_arrow_circular : Error<
"circular pointer delegation detected">;
def err_pseudo_dtor_base_not_scalar : Error<
@@ -5271,16 +5432,13 @@ let CategoryName = "Inline Assembly Issue" in {
def err_asm_tying_incompatible_types : Error<
"unsupported inline asm: input with type "
"%diff{$ matching output with type $|}0,1">;
+ def err_asm_incomplete_type : Error<"asm operand has incomplete type %0">;
def err_asm_unknown_register_name : Error<"unknown register name '%0' in asm">;
- def err_asm_empty : Error<"__asm used with no assembly instructions">;
def err_asm_invalid_input_size : Error<
"invalid input size for constraint '%0'">;
def err_invalid_asm_cast_lvalue : Error<
"invalid use of a cast in a inline asm context requiring an l-value: "
"remove the cast or build with -fheinous-gnu-extensions">;
- def err_inline_ms_asm_parsing : Error<"%0">;
- def err_msasm_unsupported_arch : Error<
- "Unsupported architecture '%0' for MS-style inline assembly">;
def warn_asm_label_on_auto_decl : Warning<
"ignored asm label '%0' on automatic variable">;
@@ -5360,6 +5518,13 @@ def ext_in_class_initializer_non_constant : Extension<
"in-class initializer for static data member is not a constant expression; "
"folding it to a constant is a GNU extension">, InGroup<GNU>;
+def err_thread_dynamic_init : Error<
+ "initializer for thread-local variable must be a constant expression">;
+def err_thread_nontrivial_dtor : Error<
+ "type of thread-local variable has non-trivial destruction">;
+def note_use_thread_local : Note<
+ "use 'thread_local' to allow this">;
+
// C++ anonymous unions and GNU anonymous structs/unions
def ext_anonymous_union : Extension<
"anonymous unions are a C11 extension">, InGroup<C11>;
@@ -5978,8 +6143,10 @@ def ext_mixed_decls_code : Extension<
"ISO C90 forbids mixing declarations and code">,
InGroup<DiagGroup<"declaration-after-statement">>;
-def err_non_variable_decl_in_for : Error<
+def err_non_local_variable_decl_in_for : Error<
"declaration of non-local variable in 'for' loop">;
+def err_non_variable_decl_in_for : Error<
+ "non-variable declaration in 'for' loop">;
def err_toomany_element_decls : Error<
"only one element declaration is allowed">;
def err_selector_element_not_lvalue : Error<
@@ -6163,6 +6330,24 @@ def err_sampler_argument_required : Error<
"sampler_t variable required - got %0">;
def err_wrong_sampler_addressspace: Error<
"sampler type cannot be used with the __local and __global address space qualifiers">;
+def err_opencl_global_invalid_addr_space : Error<
+ "global variables must have a constant address space qualifier">;
+
+// OpenMP support.
+def err_omp_expected_var_arg_suggest : Error<
+ "%0 is not a global variable, static local variable or static data member%select{|; did you mean %2?}1">;
+def err_omp_global_var_arg : Error<
+ "arguments of '#pragma omp %0' must have %select{global storage|static storage duration}1">;
+def err_omp_ref_type_arg : Error<
+ "arguments of '#pragma omp %0' cannot be of reference type %1">;
+def err_omp_var_scope : Error<
+ "'#pragma omp %0' must appear in the scope of the %1 variable declaration">;
+def err_omp_var_used : Error<
+ "'#pragma omp %0' must precede all references to variable %1">;
+def err_omp_var_thread_local : Error<
+ "variable %0 cannot be threadprivate because it is thread-local">;
+def err_omp_incomplete_type : Error<
+ "a threadprivate variable must not have incomplete type %0">;
} // end of sema category
@@ -6175,15 +6360,19 @@ def warn_related_result_type_compatibility_class : Warning<
def warn_related_result_type_compatibility_protocol : Warning<
"protocol method is expected to return an instance of the implementing "
"class, but is declared to return %0">;
-def note_related_result_type_overridden_family : Note<
- "overridden method is part of the '%select{|alloc|copy|init|mutableCopy|"
- "new|autorelease|dealloc|finalize|release|retain|retainCount|self}0' method "
- "family">;
+def note_related_result_type_family : Note<
+ "%select{overridden|current}0 method is part of the '%select{|alloc|copy|init|"
+ "mutableCopy|new|autorelease|dealloc|finalize|release|retain|retainCount|"
+ "self}1' method family%select{| and is expected to return an instance of its "
+ "class type}0">;
def note_related_result_type_overridden : Note<
"overridden method returns an instance of its class type">;
def note_related_result_type_inferred : Note<
"%select{class|instance}0 method %1 is assumed to return an instance of "
"its receiver type (%2)">;
+def note_related_result_type_explicit : Note<
+ "%select{overridden|current}0 method is explicitly declared 'instancetype'"
+ "%select{| and is expected to return an instance of its class type}0">;
}