diff options
author | Stefan Kempf <stefan@cvs.openbsd.org> | 2017-02-12 09:25:05 +0000 |
---|---|---|
committer | Stefan Kempf <stefan@cvs.openbsd.org> | 2017-02-12 09:25:05 +0000 |
commit | 96324eb5054afc7f93bb3b9c9c17d85d0b174ae8 (patch) | |
tree | 4745258490b8ee68db4dbddca16088e30d14632c /gnu/llvm | |
parent | 27318f9306de898afffe11baf6450d8d269345b4 (diff) |
Disable -Wpointer-sign warnings per default
base gcc does the same. suggested by and ok jsg@
Diffstat (limited to 'gnu/llvm')
-rw-r--r-- | gnu/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td | 1331 |
1 files changed, 1007 insertions, 324 deletions
diff --git a/gnu/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td b/gnu/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td index 6ba482c78e4..334974f4684 100644 --- a/gnu/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/gnu/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -30,23 +30,6 @@ def warn_redundant_loop_iteration : Warning< InGroup<ForLoopAnalysis>, DefaultIgnore; def note_loop_iteration_here : Note<"%select{decremented|incremented}0 here">; -def warn_for_range_const_reference_copy : Warning< - "loop variable %0 " - "%diff{has type $ but is initialized with type $" - "| is initialized with a value of a different type}1,2 resulting in a copy">, - InGroup<RangeLoopAnalysis>, DefaultIgnore; -def note_use_type_or_non_reference : Note< - "use non-reference type %0 to keep the copy or type %1 to prevent copying">; -def warn_for_range_variable_always_copy : Warning< - "loop variable %0 is always a copy because the range of type %1 does not " - "return a reference">, - InGroup<RangeLoopAnalysis>, DefaultIgnore; -def note_use_non_reference_type : Note<"use non-reference type %0">; -def warn_for_range_copy : Warning< - "loop variable %0 of type %1 creates a copy from type %2">, - InGroup<RangeLoopAnalysis>, DefaultIgnore; -def note_use_reference_type : Note<"use reference type %0 to prevent copying">; - def warn_duplicate_enum_values : Warning< "element %0 has been implicitly assigned %1 which another element has " "been assigned">, InGroup<DiagGroup<"duplicate-enum">>, DefaultIgnore; @@ -70,10 +53,22 @@ def warn_pointer_abs : Warning< "taking the absolute value of %select{pointer|function|array}0 type %1 is suspicious">, InGroup<AbsoluteValue>; +def warn_max_unsigned_zero : Warning< + "taking the max of " + "%select{a value and unsigned zero|unsigned zero and a value}0 " + "is always equal to the other value">, + InGroup<MaxUnsignedZero>; +def note_remove_max_call : Note< + "remove call to max function and unsigned zero argument">; + def warn_infinite_recursive_function : Warning< "all paths through this function will call itself">, InGroup<InfiniteRecursion>, DefaultIgnore; +def warn_comma_operator : Warning<"possible misuse of comma operator here">, + InGroup<DiagGroup<"comma">>, DefaultIgnore; +def note_cast_to_void : Note<"cast expression to void to silence warning">; + // Constant expressions def err_expr_not_ice : Error< "expression is not an %select{integer|integral}0 constant expression">; @@ -88,10 +83,12 @@ def err_typecheck_converted_constant_expression_indirect : Error< "conversion from %0 to %1 in converted constant expression would " "bind reference to a temporary">; def err_expr_not_cce : Error< - "%select{case value|enumerator value|non-type template argument|array size}0 " + "%select{case value|enumerator value|non-type template argument|" + "array size|constexpr if condition}0 " "is not a constant expression">; def ext_cce_narrowing : ExtWarn< - "%select{case value|enumerator value|non-type template argument|array size}0 " + "%select{case value|enumerator value|non-type template argument|" + "array size|constexpr if condition}0 " "%select{cannot be narrowed from type %2 to %3|" "evaluates to %2, which cannot be narrowed to type %3}1">, InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure; @@ -124,13 +121,14 @@ def warn_float_underflow : Warning< InGroup<LiteralRange>; def warn_double_const_requires_fp64 : Warning< "double precision constant requires cl_khr_fp64, casting to single precision">; +def err_half_const_requires_fp16 : Error< + "half precision constant requires cl_khr_fp16">; // C99 variable-length arrays 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 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">; def err_array_star_in_function_definition : Error< @@ -254,6 +252,13 @@ def err_bad_variable_name : Error< def err_bad_parameter_name : Error< "%0 cannot be the name of a parameter">; def err_parameter_name_omitted : Error<"parameter name omitted">; +def err_anyx86_interrupt_attribute : Error< + "%select{x86|x86-64}0 'interrupt' attribute only applies to functions that " + "have %select{a 'void' return type|" + "only a pointer parameter optionally followed by an integer parameter|" + "a pointer as the first parameter|a %2 type as the second parameter}1">; +def err_anyx86_interrupt_called : Error< + "interrupt service routine cannot be called directly">; def warn_mips_interrupt_attribute : Warning< "MIPS 'interrupt' attribute only applies to functions that have " "%select{no parameters|a 'void' return type}0">, @@ -342,12 +347,16 @@ def err_language_linkage_spec_not_ascii : Error< def warn_use_out_of_scope_declaration : Warning< "use of out-of-scope declaration of %0">; def err_inline_non_function : Error< - "'inline' can only appear on functions">; + "'inline' can only appear on functions%select{| and non-local variables}0">; def err_noreturn_non_function : Error< "'_Noreturn' can only appear on functions">; def warn_qual_return_type : Warning< "'%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect">, InGroup<IgnoredQualifiers>, DefaultIgnore; +def warn_deprecated_redundant_constexpr_static_def : Warning< + "out-of-line definition of constexpr static data member is redundant " + "in C++17 and is deprecated">, + InGroup<Deprecated>, DefaultIgnore; def warn_decl_shadow : Warning<"declaration shadows a %select{" @@ -356,6 +365,69 @@ def warn_decl_shadow : "static data member of %2|" "field of %2}1">, InGroup<Shadow>, DefaultIgnore; +def warn_decl_shadow_uncaptured_local : + Warning<warn_decl_shadow.Text>, + InGroup<ShadowUncapturedLocal>, DefaultIgnore; +def warn_ctor_parm_shadows_field: + Warning<"constructor parameter %0 shadows the field %1 of %2">, + InGroup<ShadowFieldInConstructor>, DefaultIgnore; +def warn_modifying_shadowing_decl : + Warning<"modifying constructor parameter %0 that shadows a " + "field of %1">, + InGroup<ShadowFieldInConstructorModified>, DefaultIgnore; + +// C++ decomposition declarations +def err_decomp_decl_context : Error< + "decomposition declaration not permitted in this context">; +def warn_cxx14_compat_decomp_decl : Warning< + "decomposition declarations are incompatible with " + "C++ standards before C++1z">, DefaultIgnore, InGroup<CXXPre1zCompat>; +def ext_decomp_decl : ExtWarn< + "decomposition declarations are a C++1z extension">, InGroup<CXX1z>; +def err_decomp_decl_spec : Error< + "decomposition declaration cannot be declared " + "%plural{1:'%1'|:with '%1' specifiers}0">; +def err_decomp_decl_type : Error< + "decomposition declaration cannot be declared with type %0; " + "declared type must be 'auto' or reference to 'auto'">; +def err_decomp_decl_parens : Error< + "decomposition declaration cannot be declared with parentheses">; +def err_decomp_decl_template : Error< + "decomposition declaration template not supported">; +def err_decomp_decl_not_alone : Error< + "decomposition declaration must be the only declaration in its group">; +def err_decomp_decl_requires_init : Error< + "decomposition declaration %0 requires an initializer">; +def err_decomp_decl_wrong_number_bindings : Error< + "type %0 decomposes into %2 elements, but %select{only |}3%1 " + "names were provided">; +def err_decomp_decl_unbindable_type : Error< + "cannot decompose %select{union|non-class, non-array}1 type %2">; +def err_decomp_decl_multiple_bases_with_members : Error< + "cannot decompose class type %1: " + "%select{its base classes %2 and|both it and its base class}0 %3 " + "have non-static data members">; +def err_decomp_decl_ambiguous_base : Error< + "cannot decompose members of ambiguous base class %1 of %0:%2">; +def err_decomp_decl_non_public_base : Error< + "cannot decompose members of non-public base class %1 of %0">; +def err_decomp_decl_non_public_member : Error< + "cannot decompose non-public member %0 of %1">; +def err_decomp_decl_anon_union_member : Error< + "cannot decompose class type %0 because it has an anonymous " + "%select{struct|union}1 member">; +def err_decomp_decl_std_tuple_element_not_specialized : Error< + "cannot decompose this type; 'std::tuple_element<%0>::type' " + "does not name a type">; +def err_decomp_decl_std_tuple_size_not_constant : Error< + "cannot decompose this type; 'std::tuple_size<%0>::value' " + "is not a valid integral constant expression">; +def note_in_binding_decl_init : Note< + "in implicit initialization of binding declaration %0">; + +def err_std_type_trait_not_class_template : Error< + "unsupported standard library implementation: " + "'std::%0' is not a class template">; // C++ using declarations def err_using_requires_qualname : Error< @@ -372,27 +444,19 @@ def err_using_decl_nested_name_specifier_is_not_base_class : Error< "using declaration refers into '%0', which is not a base class of %1">; def err_using_decl_constructor_not_in_direct_base : Error< "%0 is not a direct base of %1, cannot inherit constructors">; -def err_using_decl_constructor_conflict : Error< - "cannot inherit constructor, already inherited constructor with " - "the same signature">; -def note_using_decl_constructor_conflict_current_ctor : Note< - "conflicting constructor">; -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 cannot refer to class member">; +def err_ambiguous_inherited_constructor : Error< + "constructor of %0 inherited from multiple base class subobjects">; +def note_ambiguous_inherited_constructor_using : Note< + "inherited from base class %0 here">; def note_using_decl_class_member_workaround : Note< - "use %select{an alias declaration|a typedef declaration|a reference}0 " - "instead">; + "use %select{an alias declaration|a typedef declaration|a reference|" + "a const variable|a constexpr variable}0 instead">; def err_using_decl_can_not_refer_to_namespace : Error< - "using declaration cannot refer to namespace">; + "using declaration cannot refer to a namespace">; +def err_using_decl_can_not_refer_to_scoped_enum : Error< + "using declaration cannot refer to a scoped enumerator">; def err_using_decl_constructor : Error< "using declaration cannot refer to a constructor">; def warn_cxx98_compat_using_decl_constructor : Warning< @@ -404,12 +468,14 @@ def err_using_decl_template_id : Error< "using declaration cannot refer to a template specialization">; def note_using_decl_target : Note<"target of using declaration">; def note_using_decl_conflict : Note<"conflicting declaration">; -def err_using_decl_redeclaration : Error<"redeclaration of using decl">; +def err_using_decl_redeclaration : Error<"redeclaration of using declaration">; def err_using_decl_conflict : Error< "target of using declaration conflicts with declaration already in scope">; def err_using_decl_conflict_reverse : Error< "declaration conflicts with target of using declaration already in scope">; def note_using_decl : Note<"%select{|previous }0using declaration">; +def err_using_decl_redeclaration_expansion : Error< + "using declaration pack expansion at block scope produces multiple values">; def warn_access_decl_deprecated : Warning< "access declarations are deprecated; use using declarations instead">, @@ -417,15 +483,21 @@ def warn_access_decl_deprecated : Warning< def err_access_decl : Error< "ISO C++11 does not allow access declarations; " "use using declarations instead">; +def ext_dynamic_exception_spec : ExtWarn< + "ISO C++1z does not allow dynamic exception specifications">, + InGroup<DynamicExceptionSpec>, DefaultError; def warn_exception_spec_deprecated : Warning< "dynamic exception specifications are deprecated">, - InGroup<Deprecated>, DefaultIgnore; + InGroup<DeprecatedDynamicExceptionSpec>, DefaultIgnore; def note_exception_spec_deprecated : Note<"use '%0' instead">; def warn_deprecated_copy_operation : Warning< "definition of implicit copy %select{constructor|assignment operator}1 " "for %0 is deprecated because it has a user-declared " "%select{copy %select{assignment operator|constructor}1|destructor}2">, InGroup<Deprecated>, DefaultIgnore; +def warn_cxx1z_compat_exception_spec_in_signature : Warning< + "mangled name of %0 will change in C++17 due to non-throwing exception " + "specification in function signature">, InGroup<CXX1zCompat>; def warn_global_constructor : Warning< "declaration requires a global constructor">, @@ -454,6 +526,12 @@ def err_maybe_falloff_nonvoid_block : Error< "control may reach end of non-void block">; def err_falloff_nonvoid_block : Error< "control reaches end of non-void block">; +def warn_maybe_falloff_nonvoid_coroutine : Warning< + "control may reach end of non-void coroutine">, + InGroup<ReturnType>; +def warn_falloff_nonvoid_coroutine : Warning< + "control reaches end of non-void coroutine">, + InGroup<ReturnType>; def warn_suggest_noreturn_function : Warning< "%select{function|method}0 %1 could be declared with attribute 'noreturn'">, InGroup<MissingNoreturn>, DefaultIgnore; @@ -579,6 +657,8 @@ def warn_main_one_arg : Warning<"only one parameter on 'main' declaration">, def err_main_arg_wrong : Error<"%select{first|second|third|fourth}0 " "parameter of 'main' (%select{argument count|argument array|environment|" "platform-specific data}0) must be of type %1">; +def warn_main_returns_bool_literal : Warning<"bool literal returned from " + "'main'">, InGroup<Main>; def err_main_global_variable : Error<"main cannot be declared as global variable">; def warn_main_redefined : Warning<"variable named 'main' with external linkage " @@ -604,14 +684,15 @@ def err_object_cannot_be_passed_returned_by_value : Error< def err_parameters_retval_cannot_have_fp16_type : Error< "%select{parameters|function return value}0 cannot have __fp16 type; did you forget * ?">; def err_opencl_half_load_store : Error< - "%select{loading directly from|assigning directly to}0 pointer to type %1 is not allowed">; + "%select{loading directly from|assigning directly to}0 pointer to type %1 requires " + "cl_khr_fp16. Use vector data %select{load|store}0 builtin functions instead">; def err_opencl_cast_to_half : Error<"casting to type %0 is not allowed">; def err_opencl_half_declaration : Error< "declaring variable of type %0 is not allowed">; def err_opencl_half_param : Error< "declaring function parameter of type %0 is not allowed; did you forget * ?">; -def err_opencl_half_return : Error< - "declaring function return value of type %0 is not allowed; did you forget * ?">; +def err_opencl_invalid_return : Error< + "declaring function return value of type %0 is not allowed %select{; did you forget * ?|}1">; def warn_enum_value_overflow : Warning<"overflow in enumeration value">; def warn_pragma_options_align_reset_failed : Warning< "#pragma options align=reset failed: %0">, @@ -674,7 +755,9 @@ def err_recursive_superclass : Error< "trying to recursively use %0 as superclass of %1">; def err_conflicting_aliasing_type : Error<"conflicting types for alias %0">; def warn_undef_interface : Warning<"cannot find interface declaration for %0">; -def warn_duplicate_protocol_def : Warning<"duplicate protocol definition of %0 is ignored">; +def warn_duplicate_protocol_def : Warning< + "duplicate protocol definition of %0 is ignored">, + InGroup<DiagGroup<"duplicate-protocol">>; def err_protocol_has_circular_dependency : Error< "protocol has circular dependency">; def err_undeclared_protocol : Error<"cannot find protocol declaration for %0">; @@ -716,9 +799,18 @@ def note_suppressed_class_declare : Note< "class with specified objc_requires_property_definitions attribute is declared here">; def err_objc_root_class_subclass : Error< "objc_root_class attribute may only be specified on a root class declaration">; +def err_restricted_superclass_mismatch : Error< + "cannot subclass a class that was declared with the " + "'objc_subclassing_restricted' attribute">; def warn_objc_root_class_missing : Warning< "class %0 defined without specifying a base class">, InGroup<ObjCRootClass>; +def err_objc_runtime_visible_category : Error< + "cannot implement a category for class %0 that is only visible via the " + "Objective-C runtime">; +def err_objc_runtime_visible_subclass : Error< + "cannot implement subclass %0 of a superclass %1 that is only visible via the " + "Objective-C runtime">; def note_objc_needs_superclass : Note< "add a super class to fix this problem">; def warn_dup_category_def : Warning< @@ -825,7 +917,7 @@ def warn_strict_multiple_method_decl : Warning< "multiple methods named %0 found">, InGroup<StrictSelector>, DefaultIgnore; def warn_accessor_property_type_mismatch : Warning< "type of property %0 does not match type of accessor %1">; -def not_conv_function_declared_at : Note<"type conversion function declared here">; +def note_conv_function_declared_at : Note<"type conversion function declared here">; def note_method_declared_at : Note<"method %0 declared here">; def note_property_attribute : Note<"property %0 is declared " "%select{deprecated|unavailable|partial}1 here">; @@ -841,7 +933,7 @@ def warn_objc_cdirective_format_string : InGroup<ObjCCStringFormat>, DefaultIgnore; def err_objc_var_decl_inclass : Error<"cannot declare variable inside @interface or @protocol">; -def error_missing_method_context : Error< +def err_missing_method_context : Error< "missing context for method declaration">; def err_objc_property_attr_mutually_exclusive : Error< "property attributes '%0' and '%1' are mutually exclusive">; @@ -932,7 +1024,7 @@ def warn_property_getter_owning_mismatch : Warning< def warn_property_redecl_getter_mismatch : Warning< "getter name mismatch between property redeclaration (%1) and its original " "declaration (%0)">, InGroup<PropertyAttr>; -def error_property_setter_ambiguous_use : Error< +def err_property_setter_ambiguous_use : Error< "synthesized properties %0 and %1 both claim setter %2 -" " use of this setter will cause unexpected behavior">; def warn_default_atomic_custom_getter_setter : Warning< @@ -951,12 +1043,12 @@ def err_use_continuation_class_redeclaration_readwrite : Error< "'readonly' public property?)">; def err_continuation_class : Error<"class extension has no primary class">; def err_property_type : Error<"property cannot have array or function type %0">; -def error_missing_property_context : Error< +def err_missing_property_context : Error< "missing context for property implementation declaration">; -def error_bad_property_decl : Error< +def err_bad_property_decl : Error< "property implementation must have its declaration in interface %0 or one of " "its extensions">; -def error_category_property : Error< +def err_category_property : Error< "property declared in category %0 cannot be implemented in " "class implementation">; def note_property_declare : Note< @@ -965,17 +1057,17 @@ def note_protocol_property_declare : Note< "it could also be property of type %0 declared here">; def note_property_synthesize : Note< "property synthesized here">; -def error_synthesize_category_decl : Error< +def err_synthesize_category_decl : Error< "@synthesize not allowed in a category's implementation">; -def error_reference_property : Error< - "property of reference type is not supported">; -def error_missing_property_interface : Error< +def err_synthesize_on_class_property : Error< + "@synthesize not allowed on a class property %0">; +def err_missing_property_interface : Error< "property implementation in a category with no category declaration">; -def error_bad_category_property_decl : Error< +def err_bad_category_property_decl : Error< "property implementation must have its declaration in the category %0">; -def error_bad_property_context : Error< +def err_bad_property_context : Error< "property implementation must be in a class or category implementation">; -def error_missing_property_ivar_decl : Error< +def err_missing_property_ivar_decl : Error< "synthesized property %0 must either be named the same as a compatible" " instance variable or must explicitly name an instance variable">; def err_arc_perform_selector_retains : Error< @@ -1009,25 +1101,25 @@ def note_arc_weak_also_accessed_here : Note< def err_incomplete_synthesized_property : Error< "cannot synthesize property %0 with incomplete type %1">; -def error_property_ivar_type : Error< +def err_property_ivar_type : Error< "type of property %0 (%1) does not match type of instance variable %2 (%3)">; -def error_property_accessor_type : Error< +def err_property_accessor_type : Error< "type of property %0 (%1) does not match type of accessor %2 (%3)">; -def error_ivar_in_superclass_use : Error< +def err_ivar_in_superclass_use : Error< "property %0 attempting to use instance variable %1 declared in super class %2">; -def error_weak_property : Error< +def err_weak_property : Error< "existing instance variable %1 for __weak property %0 must be __weak">; -def error_strong_property : Error< +def err_strong_property : Error< "existing instance variable %1 for strong property %0 may not be __weak">; -def error_dynamic_property_ivar_decl : Error< +def err_dynamic_property_ivar_decl : Error< "dynamic property cannot have instance variable specification">; -def error_duplicate_ivar_use : Error< +def err_duplicate_ivar_use : Error< "synthesized properties %0 and %1 both claim instance variable %2">; -def error_property_implemented : Error<"property %0 is already implemented">; +def err_property_implemented : Error<"property %0 is already implemented">; def warn_objc_missing_super_call : Warning< "method possibly missing a [super %0] call">, InGroup<ObjCMissingSuperCalls>; -def error_dealloc_bad_result_type : Error< +def err_dealloc_bad_result_type : Error< "dealloc return type must be correctly specified as 'void' under ARC, " "instead of %0">; def warn_undeclared_selector : Warning< @@ -1051,7 +1143,7 @@ def warn_unimplemented_selector: Warning< InGroup<Selector>, DefaultIgnore; def warn_unimplemented_protocol_method : Warning< "method %0 in protocol %1 not implemented">, InGroup<Protocol>; -def warning_multiple_selectors: Warning< +def warn_multiple_selectors: Warning< "several methods with selector %0 of mismatched types are found " "for the @selector expression">, InGroup<SelectorTypeMismatch>, DefaultIgnore; @@ -1071,11 +1163,16 @@ def warn_cxx14_compat_static_assert_no_message : Warning< "static_assert with no message is incompatible with C++ standards before C++1z">, DefaultIgnore, InGroup<CXXPre1zCompat>; +def ext_inline_variable : ExtWarn< + "inline variables are a C++1z extension">, InGroup<CXX1z>; +def warn_cxx14_compat_inline_variable : Warning< + "inline variables are incompatible with C++ standards before C++1z">, + DefaultIgnore, InGroup<CXXPre1zCompat>; + def warn_inline_namespace_reopened_noninline : Warning< - "inline namespace cannot be reopened as a non-inline namespace">; + "inline namespace reopened as a non-inline namespace">; def err_inline_namespace_mismatch : Error< - "%select{|non-}0inline namespace " - "cannot be reopened as %select{non-|}0inline">; + "non-inline namespace cannot be reopened as inline">; def err_unexpected_friend : Error< "friends can only be classes or functions">; @@ -1210,6 +1307,8 @@ def err_distant_exception_spec : Error< def err_incomplete_in_exception_spec : Error< "%select{|pointer to |reference to }0incomplete type %1 is not allowed " "in exception specification">; +def ext_incomplete_in_exception_spec : ExtWarn<err_incomplete_in_exception_spec.Text>, + InGroup<MicrosoftExceptionSpec>; def err_rref_in_exception_spec : Error< "rvalue reference type %0 is not allowed in exception specification">; def err_mismatched_exception_spec : Error< @@ -1223,8 +1322,12 @@ def ext_override_exception_spec : ExtWarn<err_override_exception_spec.Text>, InGroup<MicrosoftExceptionSpec>; def err_incompatible_exception_specs : Error< "target exception specification is not superset of source">; +def warn_incompatible_exception_specs : Warning< + err_incompatible_exception_specs.Text>, InGroup<IncompatibleExceptionSpec>; def err_deep_exception_specs_differ : Error< "exception specifications of %select{return|argument}0 types differ">; +def warn_deep_exception_specs_differ : Warning< + err_deep_exception_specs_differ.Text>, InGroup<IncompatibleExceptionSpec>; def err_missing_exception_specification : Error< "%0 is missing exception specification '%1'">; def ext_missing_exception_specification : ExtWarn< @@ -1409,11 +1512,13 @@ def note_member_synthesized_at : Note< "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">; + "inherited constructor for %0 first required here">; def err_missing_default_ctor : Error< - "%select{|implicit default |inheriting }0constructor for %1 must explicitly " - "initialize the %select{base class|member}2 %3 which does not have a default " - "constructor">; + "%select{constructor for %1 must explicitly initialize the|" + "implicit default constructor for %1 must explicitly initialize the|" + "cannot use constructor inherited from base class %4;}0 " + "%select{base class|member}2 %3 %select{which|which|of %1}0 " + "does not have a default constructor">; def note_due_to_dllexported_class : Note< "due to '%0' being dllexported%select{|; try compiling in C++11 mode}1">; @@ -1571,7 +1676,8 @@ def err_init_conversion_failed : Error< "%select{none|const|restrict|const and restrict|volatile|const and volatile|" "volatile and restrict|const, volatile, and restrict}5 vs " "%select{none|const|restrict|const and restrict|volatile|const and volatile|" - "volatile and restrict|const, volatile, and restrict}6)}4">; + "volatile and restrict|const, volatile, and restrict}6)" + "|: different exception specifications}4">; def err_lvalue_to_rvalue_ref : Error<"rvalue reference %diff{to type $ cannot " "bind to lvalue of type $|cannot bind to incompatible lvalue}0,1">; @@ -1663,7 +1769,7 @@ def warn_maybe_uninit_var : Warning< "variable %0 may be uninitialized when " "%select{used here|captured by block}1">, InGroup<UninitializedMaybe>, DefaultIgnore; -def note_uninit_var_def : Note<"variable %0 is declared here">; +def note_var_declared_here : Note<"variable %0 is declared here">; def note_uninit_var_use : Note< "%select{uninitialized use occurs|variable is captured by block}0 here">; def warn_uninit_byref_blockvar_captured_by_block : Warning< @@ -1672,8 +1778,10 @@ def warn_uninit_byref_blockvar_captured_by_block : Warning< def note_block_var_fixit_add_initialization : Note< "did you mean to use __block %0?">; def note_in_omitted_aggregate_initializer : Note< - "in implicit initialization of %select{array element %1|field %1}0 " - "with omitted initializer">; + "in implicit initialization of %select{" + "array element %1 with omitted initializer|" + "field %1 with omitted initializer|" + "trailing array elements in runtime-sized array new}0">; def note_in_reference_temporary_list_initializer : Note< "in initialization of temporary of type %0 created to " "list-initialize this reference">; @@ -1683,6 +1791,8 @@ def note_uninit_fixit_remove_cond : Note< "remove the %select{'%1' if its condition|condition if it}0 " "is always %select{false|true}2">; def err_init_incomplete_type : Error<"initialization of incomplete type %0">; +def err_list_init_in_parens : Error<"list-initializer for non-class type %0 " + "must not be parenthesized">; def warn_unsequenced_mod_mod : Warning< "multiple unsequenced modifications to %0">, InGroup<Unsequenced>; @@ -1737,6 +1847,9 @@ def warn_cxx98_compat_auto_type_specifier : Warning< def err_auto_variable_cannot_appear_in_own_initializer : Error< "variable %0 declared with %select{'auto'|'decltype(auto)'|'__auto_type'}1 " "type cannot appear in its own initializer">; +def err_binding_cannot_appear_in_own_initializer : Error< + "binding %0 cannot appear in the initializer of its own " + "decomposition declaration">; def err_illegal_decl_array_of_auto : Error< "'%0' declared as array of %1">; def err_new_array_of_auto : Error< @@ -1750,7 +1863,8 @@ def err_auto_not_allowed : Error< "|in exception declaration|in template parameter|in block literal" "|in template argument|in typedef|in type alias|in function return type" "|in conversion function type|here|in lambda parameter" - "|in type allocated by 'new'|in K&R-style function parameter}1">; + "|in type allocated by 'new'|in K&R-style function parameter}1" + "%select{|||||||| until C++1z||||||||||}1">; def err_auto_not_allowed_var_inst : Error< "'auto' variable template instantiation is not allowed">; def err_auto_var_requires_init : Error< @@ -1905,8 +2019,12 @@ def err_for_range_iter_deduction_failure : Error< "cannot use type %0 as an iterator">; def err_for_range_member_begin_end_mismatch : Error< "range type %0 has '%select{begin|end}1' member but no '%select{end|begin}1' member">; -def err_for_range_begin_end_types_differ : Error< - "'begin' and 'end' must return the same type (got %0 and %1)">; +def ext_for_range_begin_end_types_differ : ExtWarn< + "'begin' and 'end' returning different types (%0 and %1) is a C++1z extension">, + InGroup<CXX1z>; +def warn_for_range_begin_end_types_differ : Warning< + "'begin' and 'end' returning different types (%0 and %1) is incompatible " + "with C++ standards before C++1z">, InGroup<CXXPre1zCompat>, DefaultIgnore; def note_in_for_range: Note< "when looking up '%select{begin|end}0' function for range expression " "of type %1">; @@ -1923,6 +2041,22 @@ def note_for_range_invalid_iterator : Note < "in implicit call to 'operator%select{!=|*|++}0' for iterator of type %1">; def note_for_range_begin_end : Note< "selected '%select{begin|end}0' %select{function|template }1%2 with iterator type %3">; +def warn_for_range_const_reference_copy : Warning< + "loop variable %0 " + "%diff{has type $ but is initialized with type $" + "| is initialized with a value of a different type}1,2 resulting in a copy">, + InGroup<RangeLoopAnalysis>, DefaultIgnore; +def note_use_type_or_non_reference : Note< + "use non-reference type %0 to keep the copy or type %1 to prevent copying">; +def warn_for_range_variable_always_copy : Warning< + "loop variable %0 is always a copy because the range of type %1 does not " + "return a reference">, + InGroup<RangeLoopAnalysis>, DefaultIgnore; +def note_use_non_reference_type : Note<"use non-reference type %0">; +def warn_for_range_copy : Warning< + "loop variable %0 of type %1 creates a copy from type %2">, + InGroup<RangeLoopAnalysis>, DefaultIgnore; +def note_use_reference_type : Note<"use reference type %0 to prevent copying">; // C++11 constexpr def warn_cxx98_compat_constexpr : Warning< @@ -2007,8 +2141,11 @@ def err_constexpr_local_var_no_init : Error< 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_enable_if_never_constant_expr : Error< - "'enable_if' attribute expression never produces a constant expression">; +def err_attr_cond_never_constant_expr : Error< + "%0 attribute expression never produces a constant expression">; +def err_diagnose_if_invalid_diagnostic_type : Error< + "invalid diagnostic type for 'diagnose_if'; use \"error\" or \"warning\" " + "instead">; def err_constexpr_body_no_return : Error< "no return statement in constexpr function">; def err_constexpr_return_missing_expr : Error< @@ -2067,6 +2204,16 @@ def err_concept_decl_invalid_specifiers : Error< "'%select{thread_local|inline|friend|constexpr}1'">; def err_function_concept_with_params : Error< "function concept cannot have any parameters">; +def err_function_concept_bool_ret : Error< + "declared return type of function concept must be 'bool'">; +def err_variable_concept_bool_decl : Error< + "declared type of variable concept must be 'bool'">; +def err_concept_specified_specialization : Error< + "'concept' cannot be applied on an " + "%select{explicit instantiation|explicit specialization|partial specialization}0">; +def err_concept_specialized : Error< + "%select{function|variable}0 concept cannot be " + "%select{explicitly instantiated|explicitly specialized|partially specialized}1">; // C++11 char16_t/char32_t def warn_cxx98_compat_unicode_type : Warning< @@ -2079,6 +2226,10 @@ def err_integer_sequence_negative_length : Error< def err_integer_sequence_integral_element_type : Error< "integer sequences must have integral element type">; +// __type_pack_element +def err_type_pack_element_out_of_bounds : Error< + "a parameter pack may not be accessed at an out of bounds index">; + // Objective-C++ def err_objc_decls_may_only_appear_in_global_scope : Error< "Objective-C declarations may only appear in global scope">; @@ -2101,6 +2252,10 @@ def err_attribute_too_few_arguments : Error< def err_attribute_invalid_vector_type : Error<"invalid vector element type %0">; def err_attribute_bad_neon_vector_size : Error< "Neon vector size must be 64 or 128 bits">; +def err_attribute_requires_positive_integer : Error< + "%0 attribute requires a positive integral compile time constant expression">; +def err_attribute_requires_opencl_version : Error< + "%0 attribute requires OpenCL version %1%select{| or above}2">; def warn_unsupported_target_attribute : Warning<"Ignoring unsupported '%0' in the target attribute string">, InGroup<IgnoredAttributes>; @@ -2141,10 +2296,15 @@ def err_attribute_only_once_per_parameter : Error< "%0 attribute can only be applied once per parameter">; def err_attribute_uuid_malformed_guid : Error< "uuid attribute contains a malformed GUID">; +def err_mismatched_uuid : Error<"uuid does not match previous declaration">; +def note_previous_uuid : Note<"previous uuid specified here">; def warn_attribute_pointers_only : Warning< "%0 attribute only applies to%select{| constant}1 pointer arguments">, InGroup<IgnoredAttributes>; def err_attribute_pointers_only : Error<warn_attribute_pointers_only.Text>; +def err_attribute_integers_only : Error< + "%0 attribute argument may only refer to a function parameter of integer " + "type">; def warn_attribute_return_pointers_only : Warning< "%0 attribute only applies to return values that are pointers">, InGroup<IgnoredAttributes>; @@ -2185,6 +2345,9 @@ def err_typecheck_vector_not_convertable_non_scalar : Error< "cannot convert between vector and non-scalar values (%0 and %1)">; def err_typecheck_vector_lengths_not_equal : Error< "vector operands do not have the same number of elements (%0 and %1)">; +def warn_typecheck_vector_element_sizes_not_equal : Warning< + "vector operands do not have the same elements sizes (%0 and %1)">, + InGroup<DiagGroup<"vec-elem-size">>, DefaultError; def err_ext_vector_component_exceeds_length : Error< "vector component access exceeds type %0">; def err_ext_vector_component_name_illegal : Error< @@ -2250,7 +2413,19 @@ def warn_objc_collection_literal_element : Warning< "object of type %0 is not compatible with " "%select{array element type|dictionary key type|dictionary value type}1 %2">, InGroup<ObjCLiteralConversion>; - +def err_swift_param_attr_not_swiftcall : Error< + "'%0' parameter can only be used with swiftcall calling convention">; +def err_swift_indirect_result_not_first : Error< + "'swift_indirect_result' parameters must be first parameters of function">; +def err_swift_error_result_not_after_swift_context : Error< + "'swift_error_result' parameter must follow 'swift_context' parameter">; +def err_swift_abi_parameter_wrong_type : Error< + "'%0' parameter must have pointer%select{| to unqualified pointer}1 type; " + "type here is %2">; + +def err_attribute_argument_invalid : Error< + "%0 attribute argument is invalid: %select{max must be 0 since min is 0|" + "min must not be greater than max}1">; def err_attribute_argument_is_zero : Error< "%0 attribute must be greater than 0">; def warn_attribute_argument_n_negative : Warning< @@ -2286,9 +2461,17 @@ def err_property_is_variably_modified : Error< "property %0 has a variably modified type">; def err_no_accessor_for_property : Error< "no %select{getter|setter}0 defined for property %1">; -def error_cannot_find_suitable_accessor : Error< +def err_cannot_find_suitable_accessor : Error< "cannot find suitable %select{getter|setter}0 for property %1">; +def warn_alloca_align_alignof : Warning< + "second argument to __builtin_alloca_with_align is supposed to be in bits">, + InGroup<DiagGroup<"alloca-with-align-alignof">>; + +def err_alignment_too_small : Error< + "requested alignment must be %0 or greater">; +def err_alignment_too_big : Error< + "requested alignment must be %0 or smaller">; def err_alignment_not_power_of_two : Error< "requested alignment is not a power of 2">; def err_alignment_dependent_typedef_name : Error< @@ -2298,7 +2481,10 @@ def err_attribute_aligned_too_great : Error< "requested alignment must be %0 bytes or smaller">; def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning< "%q0 redeclared without %1 attribute: previous %1 ignored">, - InGroup<DiagGroup<"inconsistent-dllimport">>; + InGroup<MicrosoftInconsistentDllImport>; +def warn_redeclaration_without_import_attribute : Warning< + "%q0 redeclared without 'dllimport' attribute: 'dllexport' attribute added">, + InGroup<MicrosoftInconsistentDllImport>; def warn_dllimport_dropped_from_inline_function : Warning< "%q0 redeclared inline; %1 attribute ignored">, InGroup<IgnoredAttributes>; @@ -2318,8 +2504,10 @@ def warn_cxx11_gnu_attribute_on_type : Warning< def warn_unhandled_ms_attribute_ignored : Warning< "__declspec attribute %0 is not supported">, InGroup<IgnoredAttributes>; -def err_attribute_invalid_on_stmt : Error< +def err_decl_attribute_invalid_on_stmt : Error< "%0 attribute cannot be applied to a statement">; +def err_stmt_attribute_invalid_on_decl : Error< + "%0 attribute cannot be applied to a declaration">; def warn_declspec_attribute_ignored : Warning< "attribute %0 is ignored, place it after " "\"%select{class|struct|interface|union|enum}1\" to apply attribute to " @@ -2410,31 +2598,68 @@ def err_attribute_weakref_without_alias : Error< def err_alias_not_supported_on_darwin : Error < "only weak aliases are supported on darwin">; def err_alias_to_undefined : Error< - "alias must point to a defined variable or function">; + "%select{alias|ifunc}0 must point to a defined %select{variable or |}1function">; def warn_alias_to_weak_alias : Warning< - "alias will always resolve to %0 even if weak definition of alias %1 is overridden">, + "%select{alias|ifunc}2 will always resolve to %0 even if weak definition of %1 is overridden">, InGroup<IgnoredAttributes>; def warn_alias_with_section : Warning< - "alias will not be in section '%0' but in the same section as the aliasee">, + "%select{alias|ifunc}1 will not be in section '%0' but in the same section as the %select{aliasee|resolver}2">, InGroup<IgnoredAttributes>; def err_duplicate_mangled_name : Error< "definition with same mangled name as another definition">; def err_cyclic_alias : Error< - "alias definition is part of a cycle">; + "%select{alias|ifunc}0 definition is part of a cycle">; +def err_ifunc_resolver_return : Error< + "ifunc resolver function must return a pointer">; +def err_ifunc_resolver_params : Error< + "ifunc resolver function must have no parameters">; def warn_attribute_wrong_decl_type : Warning< - "%0 attribute only applies to %select{functions|unions|" - "variables and functions|functions and methods|parameters|" - "functions, methods and blocks|functions, methods, and classes|" - "functions, methods, and parameters|classes|enums|variables|methods|" - "variables, functions and labels|fields and global variables|structs|" - "variables and typedefs|thread-local variables|" - "variables and fields|variables, data members and tag types|" - "types and namespaces|Objective-C interfaces|methods and properties|" - "struct or union|struct, union or class|types|" - "Objective-C instance methods|init methods of interface or class extension declarations|" - "variables, functions and classes|Objective-C protocols|" - "functions and global variables|structs, unions, and typedefs|structs and typedefs|" - "interface or protocol declarations|kernel functions|non-K&R-style functions}1">, + "%0 attribute only applies to %select{" + "functions" + "|unions" + "|variables and functions" + "|functions and global variables" + "|functions, variables, and Objective-C interfaces" + "|functions and methods" + "|parameters" + "|functions, methods and blocks" + "|functions, methods, and classes" + "|functions, methods, and parameters" + "|functions, methods, and global variables" + "|classes" + "|enums" + "|variables" + "|methods" + "|fields and global variables" + "|structs" + "|parameters and typedefs" + "|variables and typedefs" + "|thread-local variables" + "|variables and fields" + "|variables, data members and tag types" + "|types and namespaces" + "|Objective-C interfaces" + "|methods and properties" + "|struct or union" + "|struct, union or class" + "|types" + "|Objective-C instance methods" + "|init methods of interface or class extension declarations" + "|variables, functions and classes" + "|functions, variables, classes, and Objective-C interfaces" + "|Objective-C protocols" + "|variables with static or thread storage duration" + "|functions, methods, properties, and global variables" + "|structs, unions, and typedefs" + "|structs and typedefs" + "|interface or protocol declarations" + "|kernel functions" + "|non-K&R-style functions" + "|variables, enums, fields and typedefs" + "|functions, methods, enums, and classes" + "|structs, classes, variables, functions, and inline namespaces" + "|variables, functions, methods, types, enumerations, enumerators, labels, and non-static data members" + "|classes and enumerations}1">, InGroup<IgnoredAttributes>; def err_attribute_wrong_decl_type : Error<warn_attribute_wrong_decl_type.Text>; def warn_type_attribute_wrong_type : Warning< @@ -2444,9 +2669,6 @@ def warn_type_attribute_wrong_type : Warning< def warn_incomplete_encoded_type : Warning< "encoding of %0 type is incomplete because %1 component has unknown encoding">, InGroup<DiagGroup<"encode-type">>; -def warn_attribute_requires_functions_or_static_globals : Warning< - "%0 only applies to variables with static storage duration and functions">, - InGroup<IgnoredAttributes>; def warn_gnu_inline_attribute_requires_inline : Warning< "'gnu_inline' attribute requires function to be marked 'inline'," " attribute ignored">, @@ -2516,6 +2738,21 @@ def note_overridden_method : Note< def note_protocol_method : Note< "protocol method is here">; +def warn_unguarded_availability : + Warning<"%0 is only available on %1 %2 or newer">, + InGroup<UnguardedAvailability>, DefaultIgnore; +def warn_partial_availability : Warning<"%0 is only available conditionally">, + InGroup<UnguardedAvailability>, DefaultIgnore; +def note_partial_availability_silence : Note< + "explicitly redeclare %0 to silence this warning">; +def note_unguarded_available_silence : Note< + "enclose %0 in an @available check to silence this warning">; +def warn_partial_message : Warning<"%0 is partial: %1">, + InGroup<UnguardedAvailability>, DefaultIgnore; +def warn_partial_fwdclass_message : Warning< + "%0 may be partial because the receiver type is unknown">, + InGroup<UnguardedAvailability>, DefaultIgnore; + // Thread Safety Attributes def warn_invalid_capability_name : Warning< "invalid capability name '%0'; capability name must be 'mutex' or 'role'">, @@ -2682,9 +2919,6 @@ def warn_impcast_float_precision : Warning< def warn_impcast_double_promotion : Warning< "implicit conversion increases floating-point precision: %0 to %1">, InGroup<DoublePromotion>, DefaultIgnore; -def warn_impcast_float_integer : Warning< - "implicit conversion turns floating-point number into integer: %0 to %1">, - InGroup<FloatConversion>, DefaultIgnore; def warn_impcast_integer_sign : Warning< "implicit conversion changes signedness: %0 to %1">, InGroup<SignConversion>, DefaultIgnore; @@ -2701,11 +2935,24 @@ def warn_impcast_integer_precision_constant : Warning< "implicit conversion from %2 to %3 changes value from %0 to %1">, InGroup<ConstantConversion>; def warn_impcast_bitfield_precision_constant : Warning< - "implicit truncation from %2 to bitfield changes value from %0 to %1">, + "implicit truncation from %2 to bit-field changes value from %0 to %1">, InGroup<BitFieldConstantConversion>; + def warn_impcast_literal_float_to_integer : Warning< "implicit conversion from %0 to %1 changes value from %2 to %3">, InGroup<LiteralConversion>; +def warn_impcast_float_integer : Warning< + "implicit conversion turns floating-point number into integer: %0 to %1">, + InGroup<FloatConversion>, DefaultIgnore; + +def warn_impcast_float_to_integer : Warning< + "implicit conversion of out of range value from %0 to %1 changes value " + "from %2 to %3">, + InGroup<FloatOverflowConversion>, DefaultIgnore; +def warn_impcast_float_to_integer_zero : Warning< + "implicit conversion from %0 to %1 changes non-zero value from %2 to %3">, + InGroup<FloatZeroConversion>, DefaultIgnore; + def warn_impcast_string_literal_to_bool : Warning< "implicit conversion turns string literal into bool: %0 to %1">, InGroup<StringConversion>, DefaultIgnore; @@ -2791,6 +3038,10 @@ def warn_int_to_void_pointer_cast : Warning< "cast to %1 from smaller integer type %0">, InGroup<IntToVoidPointerCast>; +def warn_no_underlying_type_specified_for_enum_bitfield : Warning< + "enums in the Microsoft ABI are signed integers by default; consider giving " + "the enum %0 an unsigned underlying type to make this code portable">, + InGroup<SignedEnumBitfield>, DefaultIgnore; def warn_attribute_packed_for_bitfield : Warning< "'packed' attribute was ignored on bit-fields with single-byte alignment " "in older versions of GCC and Clang">, @@ -2844,14 +3095,16 @@ def warn_vector_mode_deprecated : Warning< InGroup<DeprecatedAttributes>; def err_complex_mode_vector_type : Error< "type of machine mode does not support base vector types">; -def err_attr_wrong_decl : Error< - "%0 attribute invalid on this declaration, requires typedef or value">; +def err_enum_mode_vector_type : Error< + "mode %0 is not supported for enumeration types">; def warn_attribute_nonnull_no_pointers : Warning< "'nonnull' attribute applied to function with no pointer arguments">, InGroup<IgnoredAttributes>; def warn_attribute_nonnull_parm_no_args : Warning< "'nonnull' attribute when used on parameters takes no arguments">, InGroup<IgnoredAttributes>; +def note_declared_nonnull : Note< + "declared %select{'returns_nonnull'|'nonnull'}0 here">; def warn_attribute_sentinel_named_arguments : Warning< "'sentinel' attribute requires named arguments">, InGroup<IgnoredAttributes>; @@ -2907,6 +3160,9 @@ def warn_ns_attribute_wrong_return_type : Warning< "%0 attribute only applies to %select{functions|methods|properties}1 that " "return %select{an Objective-C object|a pointer|a non-retainable pointer}2">, InGroup<IgnoredAttributes>; +def err_ns_attribute_wrong_parameter_type : Error< + "%0 attribute only applies to " + "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">; def warn_ns_attribute_wrong_parameter_type : Warning< "%0 attribute only applies to " "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">, @@ -3013,7 +3269,9 @@ def err_uninitialized_member_for_assign : Error< "non-static %select{reference|const}1 member %2 cannot use copy " "assignment operator">; def err_uninitialized_member_in_ctor : Error< - "%select{|implicit default |inheriting }0constructor for %1 must explicitly " + "%select{constructor for %1|" + "implicit default constructor for %1|" + "cannot use constructor inherited from %1:}0 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 " @@ -3023,6 +3281,7 @@ def err_use_of_default_argument_to_function_declared_later : Error< "use of default argument to function %0 that is declared later in class %1">; def note_default_argument_declared_here : Note< "default argument declared here">; +def err_recursive_default_argument : Error<"recursive evaluation of default argument">; def ext_param_promoted_not_compatible_with_prototype : ExtWarn< "%diff{promoted type $ of K&R function parameter is not compatible with the " @@ -3061,19 +3320,25 @@ def note_ovl_candidate : Note<"candidate " "is the implicit move constructor|" "is the implicit copy assignment operator|" "is the implicit move assignment operator|" - "is an inherited constructor}0%1" - "%select{| has different class%diff{ (expected $ but has $)|}3,4" - "| has different number of parameters (expected %3 but has %4)" - "| has type mismatch at %ordinal3 parameter" - "%diff{ (expected $ but has $)|}4,5" - "| has different return type%diff{ ($ expected but has $)|}3,4" + "inherited constructor|" + "inherited constructor }0%2" + "%select{| has different class%diff{ (expected $ but has $)|}4,5" + "| has different number of parameters (expected %4 but has %5)" + "| has type mismatch at %ordinal4 parameter" + "%diff{ (expected $ but has $)|}5,6" + "| has different return type%diff{ ($ expected but has $)|}4,5" "| has different qualifiers (expected " "%select{none|const|restrict|const and restrict|volatile|const and volatile" - "|volatile and restrict|const, volatile, and restrict}3 but found " + "|volatile and restrict|const, volatile, and restrict}4 but found " "%select{none|const|restrict|const and restrict|volatile|const and volatile" - "|volatile and restrict|const, volatile, and restrict}4)}2">; - -def note_ovl_candidate_inherited_constructor : Note<"inherited from here">; + "|volatile and restrict|const, volatile, and restrict}5)" + "| has different exception specification}3">; + +def note_ovl_candidate_inherited_constructor : Note< + "constructor from base class %0 inherited here">; +def note_ovl_candidate_inherited_constructor_slice : Note< + "constructor inherited from base class cannot be used to initialize from " + "an argument of the derived class type">; def note_ovl_candidate_illegal_constructor : Note< "candidate %select{constructor|template}0 ignored: " "instantiation %select{takes|would take}0 its own class type by value">; @@ -3084,6 +3349,10 @@ def note_ovl_candidate_incomplete_deduction : Note<"candidate template ignored: def note_ovl_candidate_inconsistent_deduction : Note< "candidate template ignored: deduced conflicting %select{types|values|" "templates}0 for parameter %1%diff{ ($ vs. $)|}2,3">; +def note_ovl_candidate_inconsistent_deduction_types : Note< + "candidate template ignored: deduced values %diff{" + "of conflicting types for parameter %0 (%1 of type $ vs. %3 of type $)|" + "%1 and %3 of conflicting types for parameter %0}2,4">; def note_ovl_candidate_explicit_arg_mismatch_named : Note< "candidate template ignored: invalid explicitly-specified argument " "for template parameter %0">; @@ -3103,20 +3372,23 @@ def note_ovl_candidate_disabled_by_enable_if : Note< def note_ovl_candidate_has_pass_object_size_params: Note< "candidate address cannot be taken because parameter %0 has " "pass_object_size attribute">; -def note_ovl_candidate_disabled_by_enable_if_attr : Note< +def err_diagnose_if_succeeded : Error<"%0">; +def warn_diagnose_if_succeeded : Warning<"%0">, InGroup<UserDefinedWarnings>; +def note_ovl_candidate_disabled_by_function_cond_attr : Note< "candidate disabled: %0">; +def note_ovl_candidate_disabled_by_extension : Note< + "candidate disabled due to OpenCL extension">; def err_addrof_function_disabled_by_enable_if_attr : Error< "cannot take address of function %0 becuase it has one or more " "non-tautological enable_if conditions">; def note_addrof_ovl_candidate_disabled_by_enable_if_attr : Note< "candidate function made ineligible by enable_if">; -def note_ovl_candidate_failed_overload_resolution : Note< - "candidate template ignored: couldn't resolve reference to overloaded " - "function %0">; def note_ovl_candidate_deduced_mismatch : Note< "candidate template ignored: deduced type " - "%diff{$ of %ordinal0 parameter does not match adjusted type $ of argument" - "|of %ordinal0 parameter does not match adjusted type of argument}1,2%3">; + "%diff{$ of %select{|element of }4%ordinal0 parameter does not match " + "adjusted type $ of %select{|element of }4argument" + "|of %select{|element of }4%ordinal0 parameter does not match " + "adjusted type of %select{|element of }4argument}1,2%3">; 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 @@ -3133,7 +3405,8 @@ def note_ovl_candidate_arity : Note<"candidate " "constructor (the implicit move constructor)|" "function (the implicit copy assignment operator)|" "function (the implicit move assignment operator)|" - "constructor (inherited)}0 %select{|template }1" + "inherited constructor|" + "inherited constructor}0 %select{|template }1" "not viable: requires%select{ at least| at most|}2 %3 argument%s3, but %4 " "%plural{1:was|:were}4 provided">; @@ -3144,7 +3417,8 @@ def note_ovl_candidate_arity_one : Note<"candidate " "constructor (the implicit move constructor)|" "function (the implicit copy assignment operator)|" "function (the implicit move assignment operator)|" - "constructor (inherited)}0 %select{|template }1not viable: " + "inherited constructor|" + "inherited constructor}0 %select{|template }1not viable: " "%select{requires at least|allows at most single|requires single}2 " "argument %3, but %plural{0:no|:%4}4 arguments were provided">; @@ -3156,7 +3430,8 @@ def note_ovl_candidate_deleted : Note< "constructor (the implicit move constructor)|" "function (the implicit copy assignment operator)|" "function (the implicit move assignment operator)|" - "constructor (inherited)}0%1 has been " + "inherited constructor|" + "inherited constructor }0%1 has been " "%select{explicitly made unavailable|explicitly deleted|" "implicitly deleted}2">; @@ -3173,9 +3448,15 @@ def note_ovl_candidate_bad_conv_incomplete : Note<"candidate " "constructor (the implicit move constructor)|" "function (the implicit copy assignment operator)|" "function (the implicit move assignment operator)|" - "constructor (inherited)}0%1 " + "inherited constructor|" + "inherited constructor }0%1 " "not viable: cannot convert argument of incomplete type " - "%diff{$ to $|to parameter type}2,3">; + "%diff{$ to $|to parameter type}2,3 for " + "%select{%ordinal5 argument|object argument}4" + "%select{|; dereference the argument with *|" + "; take the address of the argument with &|" + "; remove *|" + "; remove &}6">; def note_ovl_candidate_bad_list_argument : Note<"candidate " "%select{function|function|constructor|" "function |function |constructor |" @@ -3184,7 +3465,8 @@ def note_ovl_candidate_bad_list_argument : Note<"candidate " "constructor (the implicit move constructor)|" "function (the implicit copy assignment operator)|" "function (the implicit move assignment operator)|" - "constructor (inherited)}0%1 " + "inherited constructor|" + "inherited constructor }0%1 " "not viable: cannot convert initializer list argument to %3">; def note_ovl_candidate_bad_overload : Note<"candidate " "%select{function|function|constructor|" @@ -3194,7 +3476,8 @@ def note_ovl_candidate_bad_overload : Note<"candidate " "constructor (the implicit move constructor)|" "function (the implicit copy assignment operator)|" "function (the implicit move assignment operator)|" - "constructor (inherited)}0%1" + "inherited constructor|" + "inherited constructor }0%1" " not viable: no overload of %3 matching %2 for %ordinal4 argument">; def note_ovl_candidate_bad_conv : Note<"candidate " "%select{function|function|constructor|" @@ -3204,7 +3487,8 @@ def note_ovl_candidate_bad_conv : Note<"candidate " "constructor (the implicit move constructor)|" "function (the implicit copy assignment operator)|" "function (the implicit move assignment operator)|" - "constructor (inherited)}0%1" + "inherited constructor|" + "inherited constructor }0%1" " not viable: no known conversion " "%diff{from $ to $|from argument type to parameter type}2,3 for " "%select{%ordinal5 argument|object argument}4" @@ -3220,7 +3504,8 @@ def note_ovl_candidate_bad_arc_conv : Note<"candidate " "constructor (the implicit move constructor)|" "function (the implicit copy assignment operator)|" "function (the implicit move assignment operator)|" - "constructor (inherited)}0%1" + "inherited constructor|" + "inherited constructor }0%1" " not viable: cannot implicitly convert argument " "%diff{of type $ to $|type to parameter type}2,3 for " "%select{%ordinal5 argument|object argument}4 under ARC">; @@ -3232,7 +3517,8 @@ def note_ovl_candidate_bad_lvalue : Note<"candidate " "constructor (the implicit move constructor)|" "function (the implicit copy assignment operator)|" "function (the implicit move assignment operator)|" - "constructor (inherited)}0%1" + "inherited constructor|" + "inherited constructor }0%1" " not viable: expects an l-value for " "%select{%ordinal3 argument|object argument}2">; def note_ovl_candidate_bad_addrspace : Note<"candidate " @@ -3243,7 +3529,8 @@ def note_ovl_candidate_bad_addrspace : Note<"candidate " "constructor (the implicit move constructor)|" "function (the implicit copy assignment operator)|" "function (the implicit move assignment operator)|" - "constructor (inherited)}0%1 not viable: " + "inherited constructor|" + "inherited constructor }0%1 not viable: " "%select{%ordinal6|'this'}5 argument (%2) is in " "address space %3, but parameter must be in address space %4">; def note_ovl_candidate_bad_gc : Note<"candidate " @@ -3254,7 +3541,8 @@ def note_ovl_candidate_bad_gc : Note<"candidate " "constructor (the implicit move constructor)|" "function (the implicit copy assignment operator)|" "function (the implicit move assignment operator)|" - "constructor (inherited)}0%1 not viable: " + "inherited constructor|" + "inherited constructor }0%1 not viable: " "%select{%ordinal6|'this'}5 argument (%2) has %select{no|__weak|__strong}3 " "ownership, but parameter has %select{no|__weak|__strong}4 ownership">; def note_ovl_candidate_bad_ownership : Note<"candidate " @@ -3265,7 +3553,8 @@ def note_ovl_candidate_bad_ownership : Note<"candidate " "constructor (the implicit move constructor)|" "function (the implicit copy assignment operator)|" "function (the implicit move assignment operator)|" - "constructor (inherited)}0%1 not viable: " + "inherited constructor|" + "inherited constructor }0%1 not viable: " "%select{%ordinal6|'this'}5 argument (%2) has " "%select{no|__unsafe_unretained|__strong|__weak|__autoreleasing}3 ownership," " but parameter has %select{no|__unsafe_unretained|__strong|__weak|" @@ -3273,7 +3562,7 @@ def note_ovl_candidate_bad_ownership : Note<"candidate " def note_ovl_candidate_bad_cvr_this : Note<"candidate " "%select{|function|||function|||||" "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|}0 not viable: " + "function (the implicit move assignment operator)||}0 not viable: " "'this' argument has type %2, but method is not marked " "%select{const|restrict|const or restrict|volatile|const or volatile|" "volatile or restrict|const, volatile, or restrict}3">; @@ -3285,11 +3574,23 @@ def note_ovl_candidate_bad_cvr : Note<"candidate " "constructor (the implicit move constructor)|" "function (the implicit copy assignment operator)|" "function (the implicit move assignment operator)|" - "constructor (inherited)}0%1 not viable: " + "inherited constructor|" + "inherited constructor }0%1 not viable: " "%ordinal4 argument (%2) would lose " "%select{const|restrict|const and restrict|volatile|const and volatile|" "volatile and restrict|const, volatile, and restrict}3 qualifier" "%select{||s||s|s|s}3">; +def note_ovl_candidate_bad_unaligned : Note<"candidate " + "%select{function|function|constructor|" + "function |function |constructor |" + "constructor (the implicit default constructor)|" + "constructor (the implicit copy constructor)|" + "constructor (the implicit move constructor)|" + "function (the implicit copy assignment operator)|" + "function (the implicit move assignment operator)|" + "inherited constructor|" + "inherited constructor }0%1 not viable: " + "%ordinal4 argument (%2) would lose __unaligned qualifier">; def note_ovl_candidate_bad_base_to_derived_conv : Note<"candidate " "%select{function|function|constructor|" "function |function |constructor |" @@ -3298,20 +3599,23 @@ def note_ovl_candidate_bad_base_to_derived_conv : Note<"candidate " "constructor (the implicit move constructor)|" "function (the implicit copy assignment operator)|" "function (the implicit move assignment operator)|" - "constructor (inherited)}0%1" - " not viable: cannot %select{convert from|convert from|bind}2 " + "inherited constructor|" + "inherited constructor }0%1 not viable: " + "cannot %select{convert from|convert from|bind}2 " "%select{base class pointer|superclass|base class object of type}2 %3 to " "%select{derived class pointer|subclass|derived class reference}2 %4 for " "%ordinal5 argument">; def note_ovl_candidate_bad_target : Note< "candidate %select{function|function|constructor|" - "function |function |constructor |" + "function|function|constructor|" "constructor (the implicit default constructor)|" "constructor (the implicit copy constructor)|" "constructor (the implicit move constructor)|" "function (the implicit copy assignment operator)|" "function (the implicit move assignment operator)|" - "constructor (inherited)}0 not viable: call to " + "inherited constructor|" + "inherited constructor}0 not viable: " + "call to " "%select{__device__|__global__|__host__|__host__ __device__|invalid}1 function from" " %select{__device__|__global__|__host__|__host__ __device__|invalid}2 function">; def note_implicit_member_target_infer_collision : Note< @@ -3443,6 +3747,10 @@ 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 warn_cxx14_compat_template_nontype_parm_auto_type : Warning< + "non-type template parameters declared with %0 are incompatible with C++ " + "standards before C++1z">, + DefaultIgnore, InGroup<CXXPre1zCompat>; def err_template_param_default_arg_redefinition : Error< "template parameter redefines default argument">; def note_template_param_prev_default_arg : Note< @@ -3515,8 +3823,8 @@ def note_template_unnamed_type_here : Note< "unnamed type used in template argument was declared here">; def err_template_arg_overload_type : Error< "template argument is the type of an unresolved overloaded function">; -def err_template_arg_not_class_template : Error< - "template argument does not refer to a class template or template " +def err_template_arg_not_valid_template : Error< + "template argument does not refer to a class or alias template, or template " "template parameter">; def note_template_arg_refers_here_func : Note< "template argument refers to function template %0, here">; @@ -3537,11 +3845,13 @@ def warn_cxx98_compat_template_arg_null : Warning< def err_template_arg_untyped_null_constant : Error< "null non-type template argument must be cast to template parameter type %0">; def err_template_arg_wrongtype_null_constant : Error< - "null non-type template argument of type %0 does not match template parameter " - "of type %1">; + "null non-type template argument of type %0 does not match template parameter " + "of type %1">; +def err_non_type_template_parm_type_deduction_failure : Error< + "non-type template parameter %0 with type %1 has incompatible initializer of type %2">; def err_deduced_non_type_template_arg_type_mismatch : Error< "deduced non-type template argument does not have the same type as the " - "its corresponding template parameter%diff{ ($ vs $)|}0,1">; + "corresponding template parameter%diff{ ($ vs $)|}0,1">; def err_non_type_template_arg_subobject : Error< "non-type template argument refers to subobject '%0'">; def err_non_type_template_arg_addr_label_diff : Error< @@ -3618,6 +3928,8 @@ def ext_ms_deref_template_argument: ExtWarn< def ext_ms_delayed_template_argument: ExtWarn< "using the undeclared type %0 as a default template argument is a " "Microsoft extension">, InGroup<MicrosoftTemplate>; +def err_template_arg_deduced_incomplete_pack : Error< + "deduced incomplete pack %0 for template parameter %1">; // C++ template specialization def err_template_spec_unknown_kind : Error< @@ -3627,6 +3939,8 @@ def err_template_spec_unknown_kind : Error< "class template">; def note_specialized_entity : Note< "explicitly specialized declaration is here">; +def note_explicit_specialization_declared_here : Note< + "explicit specialization declared here">; def err_template_spec_decl_function_scope : Error< "explicit specialization of %0 in function scope">; def err_template_spec_decl_class_scope : Error< @@ -3727,8 +4041,8 @@ def err_specialize_member_of_template : Error< def err_default_arg_in_partial_spec : Error< "default template argument in a class template partial specialization">; def err_dependent_non_type_arg_in_partial_spec : Error< - "non-type template argument depends on a template parameter of the " - "partial specialization">; + "type of specialized non-type template argument depends on a template " + "parameter of the partial specialization">; def note_dependent_non_type_default_arg_in_partial_spec : Note< "template parameter is used in default argument declared here">; def err_dependent_typed_non_type_arg_in_partial_spec : Error< @@ -3738,10 +4052,16 @@ def err_partial_spec_args_match_primary_template : Error< "%select{class|variable}0 template partial specialization does not " "specialize any template argument; to %select{declare|define}1 the " "primary template, remove the template argument list">; -def warn_partial_specs_not_deducible : Warning< +def ext_partial_spec_not_more_specialized_than_primary : ExtWarn< + "%select{class|variable}0 template partial specialization is not " + "more specialized than the primary template">, DefaultError, + InGroup<DiagGroup<"invalid-partial-specialization">>; +def note_partial_spec_not_more_specialized_than_primary : Note<"%0">; +def ext_partial_specs_not_deducible : ExtWarn< "%select{class|variable}0 template partial specialization contains " "%select{a template parameter|template parameters}1 that cannot be " - "deduced; this partial specialization will never be used">; + "deduced; this partial specialization will never be used">, + DefaultError, InGroup<DiagGroup<"unusable-partial-specialization">>; def note_partial_spec_unused_parameter : Note< "non-deducible template parameter %0">; def err_partial_spec_ordering_ambiguous : Error< @@ -3749,6 +4069,8 @@ def err_partial_spec_ordering_ambiguous : Error< def note_partial_spec_match : Note<"partial specialization matches %0">; def err_partial_spec_redeclared : Error< "class template partial specialization %0 cannot be redeclared">; +def note_partial_specialization_declared_here : Note< + "explicit specialization declared here">; def note_prev_partial_spec_here : Note< "previous declaration of class template partial specialization %0 is here">; def err_partial_spec_fully_specialized : Error< @@ -3773,7 +4095,7 @@ def err_function_template_spec_ambiguous : Error< "function template; explicitly specify%select{| additional}1 template " "arguments to identify a particular function template">; def note_function_template_spec_matched : Note< - "function template matches specialization %0">; + "function template %q0 matches specialization %1">; def err_function_template_partial_spec : Error< "function template partial specialization is not allowed">; @@ -3796,9 +4118,9 @@ def note_template_class_instantiation_was_here : Note< def note_template_class_explicit_specialization_was_here : Note< "class template %0 was explicitly specialized here">; def note_template_class_instantiation_here : Note< - "in instantiation of template class %0 requested here">; + "in instantiation of template class %q0 requested here">; def note_template_member_class_here : Note< - "in instantiation of member class %0 requested here">; + "in instantiation of member class %q0 requested here">; def note_template_member_function_here : Note< "in instantiation of member function %q0 requested here">; def note_function_template_spec_here : Note< @@ -3815,7 +4137,18 @@ def note_template_type_alias_instantiation_here : Note< "in instantiation of template type alias %0 requested here">; def note_template_exception_spec_instantiation_here : Note< "in instantiation of exception specification for %0 requested here">; - +def warn_var_template_missing : Warning<"instantiation of variable %q0 " + "required here, but no definition is available">, + InGroup<UndefinedVarTemplate>; +def warn_func_template_missing : Warning<"instantiation of function %q0 " + "required here, but no definition is available">, + InGroup<UndefinedFuncTemplate>, DefaultIgnore; +def note_forward_template_decl : Note< + "forward declaration of template entity is here">; +def note_inst_declaration_hint : Note<"add an explicit instantiation " + "declaration to suppress this warning if %q0 is explicitly instantiated in " + "another translation unit">; + def note_default_arg_instantiation_here : Note< "in instantiation of default argument for '%0' required here">; def note_default_function_arg_instantiation_here : Note< @@ -3827,9 +4160,9 @@ def note_explicit_template_arg_substitution_here : Note< def note_function_template_deduction_instantiation_here : Note< "while substituting deduced template arguments into function template %0 " "%1">; -def note_partial_spec_deduct_instantiation_here : Note< - "during template argument deduction for class template partial " - "specialization %0 %1">; +def note_deduced_template_arg_substitution_here : Note< + "during template argument deduction for %select{class|variable}0 template " + "%select{partial specialization |}1%2 %3">; def note_prior_template_arg_substitution : Note< "while substituting prior template arguments into %select{non-type|template}0" " template parameter%1 %2">; @@ -3846,6 +4179,9 @@ def err_variable_instantiates_to_function : Error< def err_nested_name_spec_non_tag : Error< "type %0 cannot be used prior to '::' because it has no members">; +def err_using_pack_expansion_empty : Error< + "%select{|member}0 using declaration %1 instantiates to an empty pack">; + // C++ Explicit Instantiation def err_explicit_instantiation_duplicate : Error< "duplicate explicit instantiation of %0">; @@ -3854,14 +4190,10 @@ def ext_explicit_instantiation_duplicate : ExtWarn< InGroup<MicrosoftTemplate>; def note_previous_explicit_instantiation : Note< "previous explicit instantiation is here">; -def ext_explicit_instantiation_after_specialization : Extension< - "explicit instantiation of %0 that occurs after an explicit " - "specialization will be ignored (C++11 extension)">, - InGroup<CXX11>; -def warn_cxx98_compat_explicit_instantiation_after_specialization : Warning< - "explicit instantiation of %0 that occurs after an explicit " - "specialization is incompatible with C++98">, - InGroup<CXX98CompatPedantic>, DefaultIgnore; +def warn_explicit_instantiation_after_specialization : Warning< + "explicit instantiation of %0 that occurs after an explicit " + "specialization has no effect">, + InGroup<DiagGroup<"instantiation-after-specialization">>; def note_previous_template_specialization : Note< "previous template specialization is here">; def err_explicit_instantiation_nontemplate_type : Error< @@ -3901,7 +4233,7 @@ def err_explicit_instantiation_member_function_not_instantiated : Error< def err_explicit_instantiation_ambiguous : Error< "partial ordering for explicit instantiation of %0 is ambiguous">; def note_explicit_instantiation_candidate : Note< - "explicit instantiation candidate function template here %0">; + "explicit instantiation candidate function %q0 template here %1">; def err_explicit_instantiation_inline : Error< "explicit instantiation cannot be 'inline'">; def warn_explicit_instantiation_inline_0x : Warning< @@ -4069,17 +4401,9 @@ def err_not_found_by_two_phase_lookup : Error<"call to function %0 that is neith def note_not_found_by_two_phase_lookup : Note<"%0 should be declared prior to the " "call site%select{| or in %2| or in an associated namespace of one of its arguments}1">; def err_undeclared_use : Error<"use of undeclared %0">; -def warn_partial_availability : Warning<"%0 is only available conditionally">, - InGroup<PartialAvailability>, DefaultIgnore; -def note_partial_availability_silence : Note< - "explicitly redeclare %0 to silence this warning">; -def warn_partial_message : Warning<"%0 is partial: %1">, - InGroup<PartialAvailability>, DefaultIgnore; -def warn_partial_fwdclass_message : Warning< - "%0 may be partial because the receiver type is unknown">, - InGroup<PartialAvailability>, DefaultIgnore; def warn_deprecated : Warning<"%0 is deprecated">, InGroup<DeprecatedDeclarations>; +def note_from_diagnose_if : Note<"from 'diagnose_if' attribute on %0:">; def warn_property_method_deprecated : Warning<"property access is using %0 method which is deprecated">, InGroup<DeprecatedDeclarations>; @@ -4106,10 +4430,6 @@ def note_availability_specified_here : Note< "%select{unavailable|deleted|deprecated|partial}1 here">; def note_implicitly_deleted : Note< "explicitly defaulted function was implicitly deleted here">; -def note_inherited_deleted_here : Note< - "deleted constructor was inherited here">; -def note_cannot_inherit : Note< - "constructor cannot be inherited">; def warn_not_enough_argument : Warning< "not enough variable arguments in %0 declaration to fit a sentinel">, InGroup<Sentinel>; @@ -4123,6 +4443,10 @@ def warn_missing_prototype : Warning< InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore; def note_declaration_not_a_prototype : Note< "this declaration is not a prototype; add 'void' to make it a prototype for a zero-parameter function">; +def warn_strict_prototypes : Warning< + "this %select{function declaration is not|" + "old-style function definition is not preceded by}0 a prototype">, + InGroup<DiagGroup<"strict-prototypes">>, DefaultIgnore; def warn_missing_variable_declarations : Warning< "no previous extern declaration for non-static variable %0">, InGroup<DiagGroup<"missing-variable-declarations">>, DefaultIgnore; @@ -4132,7 +4456,7 @@ def err_redefinition : Error<"redefinition of %0">; def err_alias_after_tentative : Error<"alias definition of %0 after tentative definition">; def err_alias_is_definition : - Error<"definition %0 cannot also be an alias">; + Error<"definition %0 cannot also be an %select{alias|ifunc}1">; def err_definition_of_implicitly_declared_member : Error< "definition of implicitly declared %select{default constructor|copy " "constructor|move constructor|copy assignment operator|move assignment " @@ -4140,28 +4464,40 @@ def err_definition_of_implicitly_declared_member : Error< def err_definition_of_explicitly_defaulted_member : Error< "definition of explicitly defaulted %select{default constructor|copy " "constructor|move constructor|copy assignment operator|move assignment " - "operator|destructor}0">; + "operator|destructor|function}0">; def err_redefinition_extern_inline : Error< "redefinition of a 'extern inline' function %0 is not supported in " "%select{C99 mode|C++}1">; +def warn_attr_abi_tag_namespace : Warning< + "'abi_tag' attribute on %select{non-inline|anonymous}0 namespace ignored">, + InGroup<IgnoredAttributes>; +def err_abi_tag_on_redeclaration : Error< + "cannot add 'abi_tag' attribute in a redeclaration">; +def err_new_abi_tag_on_redeclaration : Error< + "'abi_tag' %0 missing in original declaration">; def note_deleted_dtor_no_operator_delete : Note< "virtual destructor requires an unambiguous, accessible 'operator delete'">; def note_deleted_special_member_class_subobject : Note< - "%select{default constructor|copy constructor|move constructor|" - "copy assignment operator|move assignment operator|destructor}0 of " + "%select{default constructor of|copy constructor of|move constructor of|" + "copy assignment operator of|move assignment operator of|destructor of|" + "constructor inherited by}0 " "%1 is implicitly deleted because " "%select{base class %3|%select{||||variant }4field %3}2 has " "%select{no|a deleted|multiple|an inaccessible|a non-trivial}4 " "%select{%select{default constructor|copy constructor|move constructor|copy " - "assignment operator|move assignment operator|destructor}0|destructor}5" + "assignment operator|move assignment operator|destructor|" + "%select{default|corresponding|default|default|default}4 constructor}0|" + "destructor}5" "%select{||s||}4">; def note_deleted_default_ctor_uninit_field : Note< - "default constructor of %0 is implicitly deleted because field %1 of " - "%select{reference|const-qualified}3 type %2 would not be initialized">; + "%select{default constructor of|constructor inherited by}0 " + "%1 is implicitly deleted because field %2 of " + "%select{reference|const-qualified}4 type %3 would not be initialized">; def note_deleted_default_ctor_all_const : Note< - "default constructor of %0 is implicitly deleted because all " - "%select{data members|data members of an anonymous union member}1" + "%select{default constructor of|constructor inherited by}0 " + "%1 is implicitly deleted because all " + "%select{data members|data members of an anonymous union member}2" " are const-qualified">; def note_deleted_copy_ctor_rvalue_reference : Note< "copy constructor of %0 is implicitly deleted because field %1 is of " @@ -4179,6 +4515,7 @@ def warn_undefined_internal : Warning< InGroup<DiagGroup<"undefined-internal">>; def warn_undefined_inline : Warning<"inline function %q0 is not defined">, InGroup<DiagGroup<"undefined-inline">>; +def err_undefined_inline_var : Error<"inline variable %q0 is not defined">; def note_used_here : Note<"used here">; def err_internal_linkage_redeclaration : Error< @@ -4221,6 +4558,8 @@ def err_extern_c_global_conflict : Error< "conflicts with declaration %select{in global scope|with C language linkage}0">; def note_extern_c_global_conflict : Note< "declared %select{in global scope|with C language linkage}0 here">; +def note_extern_c_begins_here : Note< + "extern \"C\" language linkage specification begins here">; def warn_weak_import : Warning < "an already-declared variable is made a weak_import declaration %0">; def ext_static_non_static : Extension< @@ -4254,10 +4593,15 @@ def err_redefinition_different_typedef : Error< "%select{typedef|type alias|type alias template}0 " "redefinition with different types%diff{ ($ vs $)|}1,2">; def err_tag_reference_non_tag : Error< - "elaborated type refers to %select{a non-tag type|a typedef|a type alias|a template|a type alias template}0">; + "%select{non-struct type|non-class type|non-union type|non-enum " + "type|typedef|type alias|template|type alias template|template " + "template argument}1 %0 cannot be referenced with a " + "%select{struct|interface|union|class|enum}2 specifier">; def err_tag_reference_conflict : Error< - "implicit declaration introduced by elaborated type conflicts with " - "%select{a declaration|a typedef|a type alias|a template}0 of the same name">; + "implicit declaration introduced by elaborated type conflicts with a " + "%select{non-struct type|non-class type|non-union type|non-enum " + "type|typedef|type alias|template|type alias template|template " + "template argument}0 of the same name">; def err_dependent_tag_decl : Error< "%select{declaration|definition}0 of " "%select{struct|interface|union|class|enum}1 in a dependent scope">; @@ -4326,9 +4670,6 @@ def err_vm_func_decl : Error< "function declaration cannot have variably modified type">; def err_array_too_large : Error< "array is too large (%0 elements)">; -def warn_array_new_too_large : Warning<"array is too large (%0 elements)">, - // FIXME PR11644: ", will throw std::bad_array_new_length at runtime" - InGroup<BadArrayNewLength>; // -Wpadded, -Wpacked def warn_padded_struct_field : Warning< @@ -4346,9 +4687,6 @@ def warn_unnecessary_packed : Warning< "packed attribute is unnecessary for %0">, InGroup<Packed>, DefaultIgnore; def err_typecheck_negative_array_size : Error<"array size is negative">; -def warn_typecheck_negative_array_new_size : Warning<"array size is negative">, - // FIXME PR11644: ", will throw std::bad_array_new_length at runtime" - InGroup<BadArrayNewLength>; def warn_typecheck_function_qualifiers_ignored : Warning< "'%0' qualifier on function type %1 has no effect">, InGroup<IgnoredQualifiers>; @@ -4517,6 +4855,10 @@ def note_protected_by_vla_typedef : Note< "jump bypasses initialization of VLA typedef">; def note_protected_by_vla_type_alias : Note< "jump bypasses initialization of VLA type alias">; +def note_protected_by_constexpr_if : Note< + "jump enters controlled statement of constexpr if">; +def note_protected_by_if_available : Note< + "jump enters controlled statement of if available">; def note_protected_by_vla : Note< "jump bypasses initialization of variable length array">; def note_protected_by_objc_try : Note< @@ -4818,6 +5160,16 @@ def err_arc_inconsistent_property_ownership : Error< } // end "ARC and @properties" category +def warn_block_capture_autoreleasing : Warning< + "block captures an autoreleasing out-parameter, which may result in " + "use-after-free bugs">, + InGroup<BlockCaptureAutoReleasing>, DefaultIgnore; +def note_declare_parameter_autoreleasing : Note< + "declare the parameter __autoreleasing explicitly to suppress this warning">; +def note_declare_parameter_strong : Note< + "declare the parameter __strong or capture a __block __strong variable to " + "keep values alive across autorelease pools">; + def err_arc_atomic_ownership : Error< "cannot perform atomic operation on a pointer to type %0: type has " "non-trivial ownership">; @@ -5066,7 +5418,7 @@ def err_typecheck_member_reference_struct_union : Error< "member reference base type %0 is not a structure or union">; def err_typecheck_member_reference_ivar : Error< "%0 does not have a member named %1">; -def error_arc_weak_ivar_access : Error< +def err_arc_weak_ivar_access : Error< "dereferencing a __weak pointer is not allowed due to possible " "null value caused by race condition, assign it to strong variable first">; def err_typecheck_member_reference_arrow : Error< @@ -5171,8 +5523,6 @@ def err_typecheck_pointer_arith_void_type : Error< "arithmetic on%select{ a|}0 pointer%select{|s}0 to void">; def err_typecheck_decl_incomplete_type : Error< "variable has incomplete type %0">; -def err_typecheck_decl_incomplete_type___float128 : Error< - "support for type '__float128' is not yet implemented">; def ext_typecheck_decl_incomplete_type : ExtWarn< "tentative definition of variable with internal linkage has incomplete non-array type %0">, InGroup<DiagGroup<"tentative-definition-incomplete-type">>; @@ -5244,7 +5594,7 @@ def err_typecheck_invalid_lvalue_addrof : Error< "cannot take the address of an rvalue of type %0">; def ext_typecheck_addrof_temporary : ExtWarn< "taking the address of a temporary object of type %0">, - InGroup<DiagGroup<"address-of-temporary">>, DefaultError; + InGroup<AddressOfTemporary>, DefaultError; def err_typecheck_addrof_temporary : Error< "taking the address of a temporary object of type %0">; def err_typecheck_addrof_dtor : Error< @@ -5257,13 +5607,20 @@ def ext_typecheck_indirection_through_void_pointer : ExtWarn< "ISO C++ does not allow indirection on operand of type %0">, InGroup<DiagGroup<"void-ptr-dereference">>; def warn_indirection_through_null : Warning< - "indirection of non-volatile null pointer will be deleted, not trap">, InGroup<NullDereference>; + "indirection of non-volatile null pointer will be deleted, not trap">, + InGroup<NullDereference>; +def warn_binding_null_to_reference : Warning< + "binding dereferenced null pointer to reference has undefined behavior">, + InGroup<NullDereference>; def note_indirection_through_null : Note< "consider using __builtin_trap() or qualifying pointer with 'volatile'">; def warn_pointer_indirection_from_incompatible_type : Warning< "dereference of type %1 that was reinterpret_cast from type %0 has undefined " "behavior">, InGroup<UndefinedReinterpretCast>, DefaultIgnore; +def warn_taking_address_of_packed_member : Warning< + "taking address of packed member %0 of class or structure %q1 may result in an unaligned pointer value">, + InGroup<DiagGroup<"address-of-packed-member">>; def err_objc_object_assignment : Error< "cannot assign to class object (%0 invalid)">; @@ -5276,6 +5633,8 @@ def ext_typecheck_ordered_comparison_of_pointer_integer : ExtWarn< "ordered comparison between pointer and integer (%0 and %1)">; def ext_typecheck_ordered_comparison_of_pointer_and_zero : Extension< "ordered comparison between pointer and zero (%0 and %1) is an extension">; +def err_typecheck_ordered_comparison_of_pointer_and_zero : Error< + "ordered comparison between pointer and zero (%0 and %1)">; def ext_typecheck_ordered_comparison_of_function_pointers : ExtWarn< "ordered comparison of function pointers (%0 and %1)">; def ext_typecheck_comparison_of_fptr_to_void : Extension< @@ -5296,12 +5655,11 @@ def err_cond_voidptr_arc : Error < "in ARC mode">; def err_typecheck_comparison_of_distinct_pointers : Error< "comparison of distinct pointer types%diff{ ($ and $)|}0,1">; -def ext_typecheck_comparison_of_distinct_pointers_nonstandard : ExtWarn< - "comparison of distinct pointer types (%0 and %1) uses non-standard " - "composite pointer type %2">, InGroup<CompareDistinctPointerType>; def err_typecheck_op_on_nonoverlapping_address_space_pointers : Error< "%select{comparison between %diff{ ($ and $)|}0,1" - "|arithmetic operation with operands of type %diff{ ($ and $)|}0,1}2" + "|arithmetic operation with operands of type %diff{ ($ and $)|}0,1" + "|conditional operator with the second and third operands of type " + "%diff{ ($ and $)|}0,1}2" " which are pointers to non-overlapping address spaces">; def err_typecheck_assign_const : Error< @@ -5348,11 +5706,13 @@ def err_shift_rhs_only_vector : Error< "requested shift is a vector of type %0 but the first operand is not a " "vector (%1)">; -def warn_logical_not_on_lhs_of_comparison : Warning< - "logical not is only applied to the left hand side of this comparison">, +def warn_logical_not_on_lhs_of_check : Warning< + "logical not is only applied to the left hand side of this " + "%select{comparison|bitwise operator}0">, InGroup<LogicalNotParentheses>; def note_logical_not_fix : Note< - "add parentheses after the '!' to evaluate the comparison first">; + "add parentheses after the '!' to evaluate the " + "%select{comparison|bitwise operator}0 first">; def note_logical_not_silence_with_parens : Note< "add parentheses around left hand side expression to silence this warning">; @@ -5460,7 +5820,7 @@ def ext_gnu_ptr_func_arith : Extension< "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 function " "type%select{|s}2 %1%select{| and %3}2 is a GNU extension">, InGroup<PointerArith>; -def error_readonly_message_assignment : Error< +def err_readonly_message_assignment : Error< "assigning to 'readonly' return result of an Objective-C message not allowed">; def ext_integer_increment_complex : Extension< "ISO C does not support '++'/'--' on complex integer type %0">; @@ -5476,7 +5836,7 @@ def err_nogetter_property_compound_assignment : Error< "a getter method is needed to perform a compound assignment on a property">; def err_nogetter_property_incdec : Error< "no getter method %1 for %select{increment|decrement}0 of property">; -def error_no_subobject_property_setting : Error< +def err_no_subobject_property_setting : Error< "expression is not assignable">; def err_qualified_objc_access : Error< "%select{property|instance variable}0 access cannot be qualified with '%1'">; @@ -5506,12 +5866,12 @@ def warn_instance_method_not_found_with_typo : Warning< def warn_class_method_not_found_with_typo : Warning< "class method %objcclass0 not found (return type defaults to 'id')" "; did you mean %objcclass2?">, InGroup<MethodAccess>; -def error_method_not_found_with_typo : Error< +def err_method_not_found_with_typo : Error< "%select{instance|class}1 method %0 not found " "; did you mean %2?">; -def error_no_super_class_message : Error< +def err_no_super_class_message : Error< "no @interface declaration found in class messaging of %0">; -def error_root_class_cannot_use_super : Error< +def err_root_class_cannot_use_super : Error< "%0 cannot use 'super' because it is a root class">; def err_invalid_receiver_to_message_super : Error< "'super' is only valid in a method body">; @@ -5526,11 +5886,11 @@ def err_bad_receiver_type : Error<"bad receiver type %0">; def err_incomplete_receiver_type : Error<"incomplete receiver type %0">; def err_unknown_receiver_suggest : Error< "unknown receiver %0; did you mean %1?">; -def error_objc_throw_expects_object : Error< +def err_objc_throw_expects_object : Error< "@throw requires an Objective-C object type (%0 invalid)">; -def error_objc_synchronized_expects_object : Error< +def err_objc_synchronized_expects_object : Error< "@synchronized requires an Objective-C object type (%0 invalid)">; -def error_rethrow_used_outside_catch : Error< +def err_rethrow_used_outside_catch : Error< "@throw (rethrow) used outside of a @catch block">; def err_attribute_multiple_objc_gc : Error< "multiple garbage collection attributes specified for type">; @@ -5572,6 +5932,16 @@ def note_parameter_here : Note< def note_method_return_type_change : Note< "compiler has implicitly changed method %0 return type">; +def warn_impl_required_for_class_property : Warning< + "class property %0 requires method %1 to be defined - " + "use @dynamic or provide a method implementation " + "in this class implementation">, + InGroup<ObjCPropertyImpl>; +def warn_impl_required_in_category_for_class_property : Warning< + "class property %0 requires method %1 to be defined - " + "use @dynamic or provide a method implementation in this category">, + InGroup<ObjCPropertyImpl>; + // C++ casts // These messages adhere to the TryCast pattern: %0 is an int specifying the // cast type, %1 is the source type, %2 is the destination type. @@ -5635,6 +6005,9 @@ def err_bad_cxx_cast_vector_to_vector_different_size : Error< def err_bad_lvalue_to_rvalue_cast : Error< "cannot cast from lvalue of type %1 to rvalue reference type %2; types are " "not compatible">; +def err_bad_rvalue_to_rvalue_cast : Error< + "cannot cast from rvalue of type %1 to rvalue reference type %2; types are " + "not compatible">; def err_bad_static_cast_pointer_nonpointer : Error< "cannot cast from type %1 to pointer type %2">; def err_bad_static_cast_member_pointer_nonmp : Error< @@ -5754,6 +6127,10 @@ def err_no_suitable_delete_member_function_found : Error< "no suitable member %0 in %1">; def err_ambiguous_suitable_delete_member_function_found : Error< "multiple suitable %0 functions in %1">; +def warn_ambiguous_suitable_delete_function_found : Warning< + "multiple suitable %0 functions for %1; no 'operator delete' function " + "will be invoked if initialization throws an exception">, + InGroup<DiagGroup<"ambiguous-delete">>; def note_member_declared_here : Note< "member %0 declared here">; def err_decrement_bool : Error<"cannot decrement expression of type bool">; @@ -5771,6 +6148,8 @@ def err_catch_incomplete_ref : Error< "cannot catch reference to incomplete type %0">; def err_catch_incomplete : Error<"cannot catch incomplete type %0">; def err_catch_rvalue_ref : Error<"cannot catch exceptions by rvalue reference">; +def err_catch_variably_modified : Error< + "cannot catch variably modified type %0">; def err_qualified_catch_declarator : Error< "exception declarator cannot be qualified">; def err_early_catch_all : Error<"catch-all handler must come last">; @@ -5802,12 +6181,14 @@ def warn_non_virtual_dtor : Warning< "%0 has virtual functions but non-virtual destructor">, InGroup<NonVirtualDtor>, DefaultIgnore; def warn_delete_non_virtual_dtor : Warning< - "delete called on non-final %0 that has virtual functions " - "but non-virtual destructor">, + "%select{delete|destructor}0 called on non-final %1 that has " + "virtual functions but non-virtual destructor">, InGroup<DeleteNonVirtualDtor>, DefaultIgnore; +def note_delete_non_virtual : Note< + "qualify call to silence this warning">; def warn_delete_abstract_non_virtual_dtor : Warning< - "delete called on %0 that is abstract but has non-virtual destructor">, - InGroup<DeleteNonVirtualDtor>; + "%select{delete|destructor}0 called on %1 that is abstract but has " + "non-virtual destructor">, InGroup<DeleteNonVirtualDtor>; def warn_overloaded_virtual : Warning< "%q0 hides overloaded virtual %select{function|functions}1">, InGroup<OverloadedVirtual>, DefaultIgnore; @@ -5821,7 +6202,8 @@ def note_hidden_overloaded_virtual_declared_here : Note< "%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">; + "volatile and restrict|const, volatile, and restrict}3)" + "|: different exception specifications}1">; def warn_using_directive_in_header : Warning< "using namespace directive in global context in header">, InGroup<HeaderHygiene>, DefaultIgnore; @@ -5909,6 +6291,8 @@ let CategoryName = "Lambda Issue" in { def note_lambda_to_block_conv : Note< "implicit capture of lambda object due to conversion to block pointer " "here">; + def note_var_explicitly_captured_here : Note<"variable %0 is" + "%select{| explicitly}1 captured here">; // C++14 lambda init-captures. def warn_cxx11_compat_init_capture : Warning< @@ -5927,6 +6311,13 @@ let CategoryName = "Lambda Issue" in { "cannot deduce type for lambda capture %0 from initializer of type %2">; def err_init_capture_deduction_failure_from_init_list : Error< "cannot deduce type for lambda capture %0 from initializer list">; + + // C++1z '*this' captures. + def warn_cxx14_compat_star_this_lambda_capture : Warning< + "by value capture of '*this' is incompatible with C++ standards before C++1z">, + InGroup<CXXPre1zCompat>, DefaultIgnore; + def ext_star_this_lambda_capture_cxx1z : ExtWarn< + "capture of '*this' by copy is a C++1z extension">, InGroup<CXX1z>; } def err_return_in_captured_stmt : Error< @@ -6056,13 +6447,14 @@ def err_typecheck_convert_incompatible : Error< "%select{none|const|restrict|const and restrict|volatile|const and volatile|" "volatile and restrict|const, volatile, and restrict}5 vs " "%select{none|const|restrict|const and restrict|volatile|const and volatile|" - "volatile and restrict|const, volatile, and restrict}6)}4">; + "volatile and restrict|const, volatile, and restrict}6)" + "|: different exception specifications}4">; def err_typecheck_missing_return_type_incompatible : Error< "%diff{return type $ must match previous return type $|" "return type must match previous return type}0,1 when %select{block " "literal|lambda expression}2 has unspecified explicit return type">; -def not_incomplete_class_and_qualified_id : Note< +def note_incomplete_class_and_qualified_id : Note< "conformance of forward class %0 to protocol %1 can not be confirmed">; def warn_incompatible_qualified_id : Warning< "%select{%diff{assigning to $ from incompatible type $|" @@ -6141,7 +6533,7 @@ def ext_typecheck_convert_incompatible_pointer_sign : ExtWarn< "sending to parameter of different type}0,1" "|%diff{casting $ to type $|casting between types}0,1}2" " converts between pointers to integer types with different sign">, - InGroup<DiagGroup<"pointer-sign">>; + InGroup<DiagGroup<"pointer-sign">>, DefaultIgnore; def ext_typecheck_convert_incompatible_pointer : ExtWarn< "incompatible pointer types " "%select{%diff{assigning to $ from $|assigning to different types}0,1" @@ -6160,6 +6552,24 @@ def ext_typecheck_convert_incompatible_pointer : ExtWarn< "; remove *|" "; remove &}3">, InGroup<IncompatiblePointerTypes>; +def ext_typecheck_convert_incompatible_function_pointer : ExtWarn< + "incompatible function pointer types " + "%select{%diff{assigning to $ from $|assigning to different types}0,1" + "|%diff{passing $ to parameter of type $|" + "passing to parameter of different type}0,1" + "|%diff{returning $ from a function with result type $|" + "returning from function with different return type}0,1" + "|%diff{converting $ to type $|converting between types}0,1" + "|%diff{initializing $ with an expression of type $|" + "initializing with expression of different type}0,1" + "|%diff{sending $ to parameter of type $|" + "sending to parameter of different type}0,1" + "|%diff{casting $ to type $|casting between types}0,1}2" + "%select{|; dereference with *|" + "; take the address with &|" + "; remove *|" + "; remove &}3">, + InGroup<IncompatibleFunctionPointerTypes>; def ext_typecheck_convert_discards_qualifiers : ExtWarn< "%select{%diff{assigning to $ from $|assigning to different types}0,1" "|%diff{passing $ to parameter of type $|" @@ -6392,9 +6802,14 @@ def err_nontemporal_builtin_must_be_pointer_intfltptr_or_vector : Error< "pointer, or a vector of such types (%0 invalid)">; def err_deleted_function_use : Error<"attempt to use a deleted function">; +def err_deleted_inherited_ctor_use : Error< + "constructor inherited by %0 from base class %1 is implicitly deleted">; +def note_called_by : Note<"called by %0">; def err_kern_type_not_void_return : Error< "kernel function type %0 must have void return type">; +def err_kern_is_nonstatic_method : Error< + "kernel function %0 must be a free function or static member function">; def err_config_scalar_return : Error< "CUDA special function 'cudaConfigureCall' must have scalar return type">; def err_kern_call_not_global_function : Error< @@ -6404,9 +6819,50 @@ def err_global_call_not_config : Error< def err_ref_bad_target : Error< "reference to %select{__device__|__global__|__host__|__host__ __device__}0 " "function %1 in %select{__device__|__global__|__host__|__host__ __device__}2 function">; -def warn_host_calls_from_host_device : Warning< - "calling __host__ function %0 from __host__ __device__ function %1 can lead to runtime errors">, +def err_ref_bad_target_global_initializer : Error< + "reference to %select{__device__|__global__|__host__|__host__ __device__}0 " + "function %1 in global initializer">; +def warn_kern_is_method : Extension< + "kernel function %0 is a member function; this may not be accepted by nvcc">, + InGroup<CudaCompat>; +def warn_kern_is_inline : Warning< + "ignored 'inline' attribute on kernel function %0">, InGroup<CudaCompat>; +def err_variadic_device_fn : Error< + "CUDA device code does not support variadic functions">; +def err_va_arg_in_device : Error< + "CUDA device code does not support va_arg">; +def err_alias_not_supported_on_nvptx : Error<"CUDA does not support aliases">; +def err_cuda_unattributed_constexpr_cannot_overload_device : Error< + "constexpr function '%0' without __host__ or __device__ attributes cannot " + "overload __device__ function with same signature. Add a __host__ " + "attribute, or build with -fno-cuda-host-device-constexpr.">; +def note_cuda_conflicting_device_function_declared_here : Note< + "conflicting __device__ function declared here">; +def err_cuda_device_exceptions : Error< + "cannot use '%0' in " + "%select{__device__|__global__|__host__|__host__ __device__}1 function">; +def err_dynamic_var_init : Error< + "dynamic initialization is not supported for " + "__device__, __constant__, and __shared__ variables.">; +def err_shared_var_init : Error< + "initialization is not supported for __shared__ variables.">; +def err_device_static_local_var : Error< + "within a %select{__device__|__global__|__host__|__host__ __device__}0 " + "function, only __shared__ variables may be marked 'static'">; +def err_cuda_vla : Error< + "cannot use variable-length arrays in " + "%select{__device__|__global__|__host__|__host__ __device__}0 functions">; +def err_cuda_extern_shared : Error<"__shared__ variable %0 cannot be 'extern'">; +def err_cuda_host_shared : Error< + "__shared__ local variables not allowed in " + "%select{__device__|__global__|__host__|__host__ __device__}0 functions">; +def err_cuda_nonglobal_constant : Error<"__constant__ variables must be global">; +def err_cuda_ovl_target : Error< + "%select{__device__|__global__|__host__|__host__ __device__}0 function %1 " + "cannot overload %select{__device__|__global__|__host__|__host__ __device__}2 function %3">; +def note_cuda_ovl_candidate_target_mismatch : Note< + "candidate template ignored: target attributes do not match">; def warn_non_pod_vararg_with_format_string : Warning< "cannot pass %select{non-POD|non-trivial}0 object of type %1 to variadic " @@ -6473,7 +6929,13 @@ def warn_cast_pointer_from_sel : Warning< def warn_function_def_in_objc_container : Warning< "function definition inside an Objective-C container is deprecated">, InGroup<FunctionDefInObjCContainer>; - + +def warn_cast_calling_conv : Warning< + "cast between incompatible calling conventions '%0' and '%1'; " + "calls through this pointer may abort at runtime">, + InGroup<DiagGroup<"cast-calling-convention">>; +def note_change_calling_conv_fixit : Note< + "consider defining %0 with the '%1' calling convention">; def warn_bad_function_cast : Warning< "cast from function call of type %0 to non-matching type %1">, InGroup<BadFunctionCast>, DefaultIgnore; @@ -6483,9 +6945,6 @@ def err_typecheck_expect_scalar_operand : Error< "operand of type %0 where arithmetic or pointer type is required">; def err_typecheck_cond_incompatible_operands : Error< "incompatible operand types%diff{ ($ and $)|}0,1">; -def ext_typecheck_cond_incompatible_operands_nonstandard : ExtWarn< - "incompatible operand types%diff{ ($ and $)|}0,1 use non-standard composite " - "pointer type %2">; def err_cast_selector_expr : Error< "cannot type cast @selector expression">; def ext_typecheck_cond_incompatible_pointers : ExtWarn< @@ -6518,12 +6977,17 @@ def warn_side_effects_typeid : Warning< "expression with side effects will be evaluated despite being used as an " "operand to 'typeid'">, InGroup<PotentiallyEvaluatedExpression>; def warn_unused_result : Warning< - "ignoring return value of function declared with warn_unused_result " - "attribute">, InGroup<DiagGroup<"unused-result">>; + "ignoring return value of function declared with %0 attribute">, + InGroup<UnusedResult>; def warn_unused_volatile : Warning< "expression result unused; assign into a variable to force a volatile load">, InGroup<DiagGroup<"unused-volatile-lvalue">>; +def ext_cxx14_attr : Extension< + "use of the %0 attribute is a C++14 extension">, InGroup<CXX14>; +def ext_cxx1z_attr : Extension< + "use of the %0 attribute is a C++1z extension">, InGroup<CXX1z>; + def warn_unused_comparison : Warning< "%select{%select{|in}1equality|relational}0 comparison result unused">, InGroup<UnusedComparison>; @@ -6532,7 +6996,12 @@ def note_inequality_comparison_to_or_assign : Note< def err_incomplete_type_used_in_type_trait_expr : Error< "incomplete type %0 used in type trait expression">; - + +def err_require_constant_init_failed : Error< + "variable does not have a constant initializer">; +def note_declared_required_constant_init_here : Note< + "required by 'require_constant_initializer' attribute here">; + def err_dimension_expr_not_constant_integer : Error< "dimension expression does not evaluate to a constant unsigned int">; @@ -6616,6 +7085,10 @@ let CategoryName = "Inline Assembly Issue" in { "constraint '%0' is already present here">; } + def error_inoutput_conflict_with_clobber : Error< + "asm-specifier for input or output variable conflicts with asm" + " clobber list">; + let CategoryName = "Semantic Issue" in { def err_invalid_conversion_between_vectors : Error< @@ -6684,12 +7157,15 @@ def err_in_class_initializer_literal_type : Error< "'constexpr' specifier">; def err_in_class_initializer_non_constant : Error< "in-class initializer for static data member is not a constant expression">; -def err_in_class_initializer_not_yet_parsed - : Error<"cannot use defaulted default constructor of %0 within the class " - "outside of member functions because %1 has an initializer">; -def err_in_class_initializer_not_yet_parsed_outer_class - : Error<"cannot use defaulted default constructor of %0 within " - "%1 outside of member functions because %2 has an initializer">; +def err_in_class_initializer_not_yet_parsed : Error< + "default member initializer for %1 needed within definition of enclosing " + "class %0 outside of member functions">; +def note_in_class_initializer_not_yet_parsed : Note< + "default member initializer declared here">; +def err_in_class_initializer_cycle + : Error<"default member initializer for %0 uses itself">; +def err_exception_spec_cycle + : Error<"exception specification of %0 uses itself">; def ext_in_class_initializer_non_constant : Extension< "in-class initializer for static data member is not a constant expression; " @@ -6740,14 +7216,9 @@ def ext_ms_anonymous_record : ExtWarn< InGroup<MicrosoftAnonTag>; // C++ local classes -def err_reference_to_local_var_in_enclosing_function : Error< - "reference to local variable %0 declared in enclosing function %1">; -def err_reference_to_local_var_in_enclosing_block : Error< - "reference to local variable %0 declared in enclosing block literal">; -def err_reference_to_local_var_in_enclosing_lambda : Error< - "reference to local variable %0 declared in enclosing lambda expression">; -def err_reference_to_local_var_in_enclosing_context : Error< - "reference to local variable %0 declared in enclosing context">; +def err_reference_to_local_in_enclosing_context : Error< + "reference to local %select{variable|binding}1 %0 declared in enclosing " + "%select{%3|block literal|lambda expression|context}2">; def err_static_data_member_not_allowed_in_local_class : Error< "static data member %0 not allowed in local class %1">; @@ -6849,9 +7320,16 @@ def err_literal_operator_id_outside_namespace : Error< "non-namespace scope '%0' cannot have a literal operator member">; def err_literal_operator_default_argument : Error< "literal operator cannot have a default argument">; -// FIXME: This diagnostic sucks -def err_literal_operator_params : Error< - "parameter declaration for literal operator %0 is not valid">; +def err_literal_operator_bad_param_count : Error< + "non-template literal operator must have one or two parameters">; +def err_literal_operator_invalid_param : Error< + "parameter of literal operator must have type 'unsigned long long', 'long double', 'char', 'wchar_t', 'char16_t', 'char32_t', or 'const char *'">; +def err_literal_operator_param : Error< + "invalid literal operator parameter type %0, did you mean %1?">; +def err_literal_operator_template_with_params : Error< + "literal operator template cannot have any parameters">; +def err_literal_operator_template : Error< + "template parameter list for literal operator must be either 'char...' or 'typename T, T...'">; def err_literal_operator_extern_c : Error< "literal operator must have C++ linkage">; def ext_string_literal_operator_template : ExtWarn< @@ -7043,6 +7521,12 @@ def warn_format_non_standard: Warning< def warn_format_non_standard_conversion_spec: Warning< "using length modifier '%0' with conversion specifier '%1' is not supported by ISO C">, InGroup<FormatNonStandard>, DefaultIgnore; +def warn_format_invalid_annotation : Warning< + "using '%0' format specifier annotation outside of os_log()/os_trace()">, + InGroup<Format>; +def warn_format_P_no_precision : Warning< + "using '%%P' format specifier without precision">, + InGroup<Format>; def warn_printf_ignored_flag: Warning< "flag '%0' is ignored when flag '%1' is present">, InGroup<Format>; @@ -7061,6 +7545,8 @@ def warn_scanf_scanlist_incomplete : Warning< def note_format_string_defined : Note<"format string is defined here">; def note_format_fix_specifier : Note<"did you mean to use '%0'?">; def note_printf_c_str: Note<"did you mean to call the %0 method?">; +def note_format_security_fixit: Note< + "treat the string as an argument to avoid this">; def warn_null_arg : Warning< "null passed to a callee that requires a non-null argument">, @@ -7159,7 +7645,7 @@ def err_generic_sel_multi_match : Error< // Blocks def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks" - " or pick a deployment target that supports them">; + " or %select{pick a deployment target that supports them|for OpenCL 2.0 or above}0">; def err_block_returning_array_function : Error< "block cannot return %select{array|function}0 type %1">; @@ -7177,6 +7663,15 @@ def warn_cfstring_truncated : Warning< "belong to the input codeset UTF-8">, InGroup<DiagGroup<"CFString-literal">>; +// os_log checking +// TODO: separate diagnostic for os_trace() +def err_os_log_format_not_string_constant : Error< + "os_log() format argument is not a string constant">; +def err_os_log_argument_too_big : Error< + "os_log() argument %0 is too big (%1 bytes, max %2)">; +def warn_os_log_format_narg : Error< + "os_log() '%%n' format specifier is not allowed">, DefaultError; + // Statements. def err_continue_not_in_loop : Error< "'continue' statement not in loop statement">; @@ -7228,16 +7723,15 @@ def note_insert_fallthrough_fixit : Note< def note_insert_break_fixit : Note< "insert 'break;' to avoid fall-through">; def err_fallthrough_attr_wrong_target : Error< - "clang::fallthrough attribute is only allowed on empty statements">; + "%0 attribute is only allowed on empty statements">; def note_fallthrough_insert_semi_fixit : Note<"did you forget ';'?">; def err_fallthrough_attr_outside_switch : Error< "fallthrough annotation is outside switch statement">; -def warn_fallthrough_attr_invalid_placement : Warning< - "fallthrough annotation does not directly precede switch label">, - InGroup<ImplicitFallthrough>; +def err_fallthrough_attr_invalid_placement : Error< + "fallthrough annotation does not directly precede switch label">; def warn_fallthrough_attr_unreachable : Warning< "fallthrough annotation in unreachable code">, - InGroup<ImplicitFallthrough>; + InGroup<ImplicitFallthrough>, DefaultIgnore; def warn_unreachable_default : Warning< "default label in switch which covers all enumeration values">, @@ -7281,10 +7775,13 @@ def err_va_start_used_in_wrong_abi_function : Error< "'va_start' used in %select{System V|Win64}0 ABI function">; def err_ms_va_start_used_in_sysv_function : Error< "'__builtin_ms_va_start' used in System V ABI function">; -def warn_second_parameter_of_va_start_not_last_named_argument : Warning< - "second parameter of 'va_start' not last named argument">, InGroup<Varargs>; -def warn_va_start_of_reference_type_is_undefined : Warning< - "'va_start' has undefined behavior with reference types">, InGroup<Varargs>; +def warn_second_arg_of_va_start_not_last_named_param : Warning< + "second argument to 'va_start' is not the last named parameter">, + InGroup<Varargs>; +def warn_va_start_type_is_undefined : Warning< + "passing %select{an object that undergoes default argument promotion|" + "an object of reference type|a parameter declared with the 'register' " + "keyword}0 to 'va_start' has undefined behavior">, InGroup<Varargs>; def err_first_argument_to_va_arg_not_of_type_va_list : Error< "first argument to 'va_arg' is of type %0 and not 'va_list'">; def err_second_parameter_to_va_arg_incomplete: Error< @@ -7379,6 +7876,8 @@ def err_invalid_neon_type_code : Error< "incompatible constant for this __builtin_neon function">; def err_argument_invalid_range : Error< "argument should be a value from %0 to %1">; +def err_argument_not_multiple : Error< + "argument should be a multiple of %0">; def warn_neon_vector_initializer_non_portable : Warning< "vector initializers are not compatible with NEON intrinsics in big endian " "mode">, InGroup<DiagGroup<"nonportable-vector-initialization">>; @@ -7397,6 +7896,8 @@ def err_ppc_builtin_only_on_pwr7 : Error< "this builtin is only valid on POWER7 or later CPUs">; def err_x86_builtin_32_bit_tgt : Error< "this builtin is only available on x86-64 targets">; +def err_x86_builtin_invalid_rounding : Error< + "invalid rounding argument">; def err_builtin_longjmp_unsupported : Error< "__builtin_longjmp is not supported for the current target">; @@ -7469,10 +7970,8 @@ def ext_c99_array_usage : Extension< def err_c99_array_usage_cxx : Error< "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 " "feature, not permitted in C++">; - def err_type_requires_extension : Error< - "use of type %0 requires %1 extension to be enabled">; -def err_int128_unsupported : Error< - "__int128 is not supported on this target">; +def err_type_unsupported : Error< + "%0 is not supported on this target">; def err_nsconsumed_attribute_mismatch : Error< "overriding method has mismatched ns_consumed attribute on its" " parameter">; @@ -7486,7 +7985,7 @@ def err_invalid_protocol_qualifiers : Error< "invalid protocol qualifiers on non-ObjC type">; def warn_ivar_use_hidden : Warning< "local declaration of %0 hides instance variable">, - InGroup<DiagGroup<"shadow-ivar">>; + InGroup<ShadowIvar>; def warn_direct_initialize_call : Warning< "explicit call to +initialize results in duplicate call to +initialize">, InGroup<ExplicitInitializeCall>; @@ -7494,13 +7993,11 @@ def warn_direct_super_initialize_call : Warning< "explicit call to [super initialize] should only be in implementation " "of +initialize">, InGroup<ExplicitInitializeCall>; -def error_ivar_use_in_class_method : Error< +def err_ivar_use_in_class_method : Error< "instance variable %0 accessed in class method">; -def error_implicit_ivar_access : Error< - "instance variable %0 cannot be accessed because 'self' has been redeclared">; -def error_private_ivar_access : Error<"instance variable %0 is private">, +def err_private_ivar_access : Error<"instance variable %0 is private">, AccessControl; -def error_protected_ivar_access : Error<"instance variable %0 is protected">, +def err_protected_ivar_access : Error<"instance variable %0 is protected">, AccessControl; def warn_maynot_respond : Warning<"%0 may not respond to %1">; def ext_typecheck_base_super : Warning< @@ -7541,6 +8038,8 @@ def err_typecheck_member_reference_ivar_suggest : Error< "%0 does not have a member named %1; did you mean %2?">; def err_property_not_found_suggest : Error< "property %0 not found on object of type %1; did you mean %2?">; +def err_class_property_found : Error< + "property %0 is a class property; did you mean to access it with class '%1'?">; def err_ivar_access_using_property_syntax_suggest : Error< "property %0 not found on object of type %1; did you mean to access instance variable %2?">; def warn_property_access_suggest : Warning< @@ -7585,6 +8084,9 @@ def err_unsupported_unknown_any_call : Error< def err_unknown_any_addrof : Error< "the address of a declaration with unknown type " "can only be cast to a pointer type">; +def err_unknown_any_addrof_call : Error< + "address-of operator cannot be applied to a call to a function with " + "unknown return type">; def err_unknown_any_var_function_type : Error< "variable %0 with unknown type cannot be given a function type">; def err_unknown_any_function : Error< @@ -7600,9 +8102,6 @@ def err_asm_naked_this_ref : Error< def err_asm_naked_parm_ref : Error< "parameter references not allowed in naked functions">; -def ext_deprecated_attr_is_a_cxx14_extension : ExtWarn< - "use of the 'deprecated' attribute is a C++14 extension">, InGroup<CXX14>; - // OpenCL warnings and errors. def err_invalid_astype_of_different_size : Error< "invalid reinterpretation: sizes of %0 and %1 must match">; @@ -7610,14 +8109,15 @@ def err_static_kernel : Error< "kernel functions cannot be declared static">; def err_opencl_ptrptr_kernel_param : Error< "kernel parameter cannot be declared as a pointer to a pointer">; -def err_opencl_private_ptr_kernel_param : Error< - "kernel parameter cannot be declared as a pointer to the __private address space">; -def err_opencl_non_kernel_variable : Error< - "non-kernel function variable cannot be declared in %0 address space">; +def err_kernel_arg_address_space : Error< + "pointer arguments to kernel functions must reside in '__global', " + "'__constant' or '__local' address space">; +def err_opencl_function_variable : Error< + "%select{non-kernel function|function scope}0 variable cannot be declared in %1 address space">; def err_static_function_scope : Error< "variables in function scope cannot be declared static">; def err_opencl_bitfields : Error< - "bitfields are not supported in OpenCL">; + "bit-fields are not supported in OpenCL">; def err_opencl_vla : Error< "variable length arrays are not supported in OpenCL">; def err_bad_kernel_param_type : Error< @@ -7628,20 +8128,24 @@ def note_within_field_of_type : Note< "within field of type %0 declared here">; def note_illegal_field_declared_here : Note< "field of illegal %select{type|pointer type}0 %1 declared here">; -def err_event_t_global_var : Error< - "the event_t type cannot be used to declare a program scope variable">; -def err_event_t_struct_field : Error< - "the event_t type cannot be used to declare a structure or union field">; +def err_opencl_type_struct_or_union_field : Error< + "the %0 type cannot be used to declare a structure or union field">; def err_event_t_addr_space_qual : Error< "the event_t type can only be used with __private address space qualifier">; def err_expected_kernel_void_return_type : Error< "kernel must have void return type">; +def err_sampler_initializer_not_integer : Error< + "sampler_t initialization requires 32-bit integer, not %0">; +def warn_sampler_initializer_invalid_bits : Warning< + "sampler initializer has invalid %0 bits">, InGroup<SpirCompat>, DefaultIgnore; 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_cast_non_zero_to_event_t : Error< + "cannot cast non-zero value '%0' to 'event_t'">; def err_opencl_global_invalid_addr_space : Error< - "program scope variable must reside in %0 address space">; + "%select{program scope|static local|extern}0 variable must reside in %1 address space">; def err_missing_actual_pipe_type : Error< "missing actual type specifier for pipe">; def err_reference_pipe_type : Error < @@ -7658,11 +8162,78 @@ def err_atomic_init_constant : Error< " in the declaration statement in the program scope">; def err_opencl_implicit_vector_conversion : Error< "implicit conversions between vector types (%0 and %1) are not permitted">; +def err_opencl_invalid_type_array : Error< + "array of %0 type is invalid in OpenCL">; +def err_opencl_ternary_with_block : Error< + "block type cannot be used as expression in ternary expression in OpenCL">; +def err_opencl_pointer_to_type : Error< + "pointer to type %0 is invalid in OpenCL">; +def err_opencl_type_can_only_be_used_as_function_parameter : Error < + "type %0 can only be used as a function parameter in OpenCL">; +def warn_opencl_attr_deprecated_ignored : Warning < + "%0 attribute is deprecated and ignored in OpenCL version %1">, + InGroup<IgnoredAttributes>; +def err_opencl_variadic_function : Error< + "invalid prototype, variadic arguments are not allowed in OpenCL">; +def err_opencl_requires_extension : Error< + "use of %select{type |declaration}0%1 requires %2 extension to be enabled">; + +// OpenCL v2.0 s6.13.6 -- Builtin Pipe Functions +def err_opencl_builtin_pipe_first_arg : Error< + "first argument to %0 must be a pipe type">; +def err_opencl_builtin_pipe_arg_num : Error< + "invalid number of arguments to function: %0">; +def err_opencl_builtin_pipe_invalid_arg : Error< + "invalid argument type to function %0 (expecting %1 having %2)">; +def err_opencl_builtin_pipe_invalid_access_modifier : Error< + "invalid pipe access modifier (expecting %0)">; + +// OpenCL access qualifier +def err_opencl_invalid_access_qualifier : Error< + "access qualifier can only be used for pipe and image type">; +def err_opencl_invalid_read_write : Error< + "access qualifier %0 can not be used for %1 %select{|prior to OpenCL version 2.0}2">; +def err_opencl_multiple_access_qualifiers : Error< + "multiple access qualifiers">; +def note_opencl_typedef_access_qualifier : Note< + "previously declared '%0' here">; // OpenCL Section 6.8.g def err_opencl_unknown_type_specifier : Error< - "OpenCL does not support the '%0' %select{type qualifier|storage class specifier}1">; - + "OpenCL version %0 does not support the '%1' %select{type qualifier|storage class specifier}2">; + +// OpenCL v2.0 s6.12.5 Blocks restrictions +def err_opencl_block_storage_type : Error< + "the __block storage type is not permitted">; +def err_opencl_invalid_block_declaration : Error< + "invalid block variable declaration - must be %select{const qualified|initialized}0">; +def err_opencl_extern_block_declaration : Error< + "invalid block variable declaration - using 'extern' storage class is disallowed">; + +// OpenCL v2.0 s6.13.9 - Address space qualifier functions. +def err_opencl_builtin_to_addr_arg_num : Error< + "invalid number of arguments to function: %0">; +def err_opencl_builtin_to_addr_invalid_arg : Error< + "invalid argument %0 to function: %1, expecting a generic pointer argument">; + +// OpenCL v2.0 s6.13.17 Enqueue kernel restrictions. +def err_opencl_enqueue_kernel_incorrect_args : Error< + "illegal call to enqueue_kernel, incorrect argument types">; +def err_opencl_enqueue_kernel_expected_type : Error< + "illegal call to enqueue_kernel, expected %0 argument type">; +def err_opencl_enqueue_kernel_local_size_args : Error< + "mismatch in number of block parameters and local size arguments passed">; +def err_opencl_enqueue_kernel_invalid_local_size_type : Error< + "illegal call to enqueue_kernel, parameter needs to be specified as integer type">; +def err_opencl_enqueue_kernel_blocks_non_local_void_args : Error< + "blocks used in device side enqueue are expected to have parameters of type 'local void*'">; +def err_opencl_enqueue_kernel_blocks_no_args : Error< + "blocks in this form of device side enqueue call are expected to have have no parameters">; + +// OpenCL v2.2 s2.1.2.3 - Vector Component Access +def ext_opencl_ext_vector_type_rgba_selector: ExtWarn< + "vector component name '%0' is an OpenCL version 2.2 feature">, + InGroup<OpenCLUnsupportedRGBA>; } // end of sema category let CategoryName = "OpenMP Issue" in { @@ -7676,6 +8247,8 @@ 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_region_not_file_context : Error< + "directive must be at file or namespace scope">; def err_omp_var_scope : Error< "'#pragma omp %0' must appear in the scope of the %q1 variable declaration">; def err_omp_var_used : Error< @@ -7692,10 +8265,28 @@ def err_omp_reduction_incomplete_type : Error< "a reduction list item with incomplete type %0">; def err_omp_unexpected_clause_value : Error< "expected %0 in OpenMP clause '%1'">; -def err_omp_expected_var_name : Error< - "expected variable name">; -def err_omp_expected_var_name_or_array_item : Error< - "expected variable name, array element or array section">; +def err_omp_expected_var_name_member_expr : Error< + "expected variable name%select{| or data member of current class}0">; +def err_omp_expected_var_name_member_expr_or_array_item : Error< + "expected variable name%select{|, data member of current class}0, array element or array section">; +def err_omp_expected_named_var_member_or_array_expression: Error< + "expected expression containing only member accesses and/or array sections based on named variables">; +def err_omp_bit_fields_forbidden_in_clause : Error< + "bit fields cannot be used to specify storage in a '%0' clause">; +def err_array_section_does_not_specify_contiguous_storage : Error< + "array section does not specify contiguous storage">; +def err_omp_union_type_not_allowed : Error< + "mapped storage cannot be derived from a union">; +def err_omp_expected_access_to_data_field : Error< + "expected access to data field">; +def err_omp_multiple_array_items_in_map_clause : Error< + "multiple array elements associated with the same variable are not allowed in map clauses of the same construct">; +def err_omp_pointer_mapped_along_with_derived_section : Error< + "pointer cannot be mapped along with a section derived from itself">; +def err_omp_original_storage_is_shared_and_does_not_contain : Error< + "original storage of expression in data environment is shared but data environment do not fully contain mapped expression storage">; +def err_omp_same_pointer_derreferenced : Error< + "same pointer derreferenced in multiple different ways in map clause expressions">; def note_omp_task_predetermined_firstprivate_here : Note< "predetermined as a firstprivate in a task construct here">; def err_omp_threadprivate_incomplete_type : Error< @@ -7733,6 +8324,8 @@ def err_omp_negative_expression_in_clause : Error< def err_omp_not_integral : Error< "expression must have integral or unscoped enumeration " "type, not %0">; +def err_omp_threadprivate_in_target : Error< + "threadprivate variables cannot be used in target constructs">; def err_omp_incomplete_type : Error< "expression has incomplete class type %0">; def err_omp_explicit_conversion : Error< @@ -7759,12 +8352,23 @@ def warn_omp_linear_step_zero : Warning< def warn_omp_alignment_not_power_of_two : Warning< "aligned clause will be ignored because the requested alignment is not a power of 2">, InGroup<OpenMPClauses>; +def err_omp_enclosed_declare_target : Error< + "declare target region may not be enclosed within another declare target region">; +def err_omp_invalid_target_decl : Error< + "%0 used in declare target directive is not a variable or a function name">; +def err_omp_declare_target_multiple : Error< + "%0 appears multiple times in clauses on the same declare target directive">; +def err_omp_declare_target_to_and_link : Error< + "%0 must not appear in both clauses 'to' and 'link'">; +def warn_omp_not_in_target_context : Warning< + "declaration is not declared in any declare target region">, + InGroup<OpenMPTarget>; def err_omp_aligned_expected_array_or_ptr : Error< "argument of aligned clause should be array" "%select{ or pointer|, pointer, reference to array or reference to pointer}1" ", not %0">; def err_omp_aligned_twice : Error< - "a variable cannot appear in more than one aligned clause">; + "%select{a variable|a parameter|'this'}0 cannot appear in more than one aligned clause">; def err_omp_local_var_in_threadprivate_init : Error< "variable with local storage in initial value of threadprivate variable">; def err_omp_loop_not_canonical_init : Error< @@ -7797,9 +8401,10 @@ def warn_omp_loop_64_bit_var : Warning< "OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed">, InGroup<OpenMPLoopForm>; def err_omp_unknown_reduction_identifier : Error< - "incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max'">; -def err_omp_reduction_type_array : Error< - "a reduction list item with array type %0">; + "incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', " + "'&&', '||', 'min' or 'max' or declare reduction for type %0">; +def err_omp_not_resolved_reduction_identifier : Error< + "unable to resolve declare reduction construct for type %0">; def err_omp_reduction_ref_type_arg : Error< "argument of OpenMP clause 'reduction' must reference the same object in all threads">; def err_omp_clause_not_arithmetic_type_arg : Error< @@ -7808,6 +8413,8 @@ def err_omp_clause_floating_type_arg : Error< "arguments of OpenMP clause 'reduction' with bitwise operators cannot be of floating type">; def err_omp_once_referenced : Error< "variable can appear only once in OpenMP '%0' clause">; +def err_omp_once_referenced_in_target_update : Error< + "variable can appear only once in OpenMP 'target update' construct">; def note_omp_referenced : Note< "previously referenced here">; def err_omp_reduction_in_task : Error< @@ -7883,12 +8490,19 @@ def err_omp_single_copyprivate_with_nowait : Error< "the 'copyprivate' clause must not be used with the 'nowait' clause">; def note_omp_nowait_clause_here : Note< "'nowait' clause is here">; +def err_omp_single_decl_in_declare_simd : Error< + "single declaration is expected after 'declare simd' directive">; +def err_omp_function_expected : Error< + "'#pragma omp declare simd' can only be applied to functions">; def err_omp_wrong_cancel_region : Error< "one of 'for', 'parallel', 'sections' or 'taskgroup' is expected">; def err_omp_parent_cancel_region_nowait : Error< "parent region for 'omp %select{cancellation point/cancel}0' construct cannot be nowait">; def err_omp_parent_cancel_region_ordered : Error< "parent region for 'omp %select{cancellation point/cancel}0' construct cannot be ordered">; +def err_omp_reduction_wrong_type : Error<"reduction type cannot be %select{qualified with 'const', 'volatile' or 'restrict'|a function|a reference|an array}0 type">; +def err_omp_wrong_var_in_declare_reduction : Error<"only %select{'omp_priv' or 'omp_orig'|'omp_in' or 'omp_out'}0 variables are allowed in %select{initializer|combiner}0 expression">; +def err_omp_declare_reduction_redefinition : Error<"redefinition of user-defined reduction for type %0">; def err_omp_array_section_use : Error<"OpenMP array section is not allowed here">; def err_omp_typecheck_section_value : Error< "subscripted value is not an array or pointer">; @@ -7900,8 +8514,10 @@ def warn_omp_section_is_char : Warning<"array section %select{lower bound|length InGroup<CharSubscript>, DefaultIgnore; def err_omp_section_incomplete_type : Error< "section of pointer to incomplete type %0">; -def err_omp_section_negative : Error< - "section %select{lower bound|length}0 is evaluated to a negative value %1">; +def err_omp_section_not_subset_of_array : Error< + "array section must be a subset of the original array">; +def err_omp_section_length_negative : Error< + "section length is evaluated to a negative value %0">; def err_omp_section_length_undefined : Error< "section length is unspecified and cannot be inferred because subscripted value is %select{not an array|an array of unknown bound}0">; def err_omp_wrong_linear_modifier : Error< @@ -7930,12 +8546,16 @@ def err_omp_map_shared_storage : Error< "variable already marked as mapped in current construct">; def err_omp_not_mappable_type : Error< "type %0 is not mappable to target">; +def err_omp_invalid_map_type_for_directive : Error< + "%select{map type '%1' is not allowed|map type must be specified}0 for '#pragma omp %2'">; +def err_omp_no_map_for_directive : Error< + "expected at least one map clause for '#pragma omp %0'">; def note_omp_polymorphic_in_target : Note< "mappable type cannot be polymorphic">; def note_omp_static_member_in_target : Note< "mappable type cannot contain static members">; -def err_omp_threadprivate_in_map : Error< - "threadprivate variables are not allowed in map clause">; +def err_omp_threadprivate_in_clause : Error< + "threadprivate variables are not allowed in '%0' clause">; def err_omp_wrong_ordered_loop_count : Error< "the parameter of the 'ordered' clause must be greater than or equal to the parameter of the 'collapse' clause">; def note_collapse_loop_count : Note< @@ -7960,8 +8580,6 @@ def err_omp_firstprivate_distribute_in_teams_reduction : Error< "reduction variable in '#pragma omp teams' cannot be firstprivate in '#pragma omp distribute'">; def err_omp_depend_clause_thread_simd : Error< "'depend' clauses cannot be mixed with '%0' clause">; -def err_omp_depend_sink_wrong_expr : Error< - "expected expression form x[+-d], where x is the loop iteration variable and d is a constant non-negative integer">; def err_omp_depend_sink_expected_loop_iteration : Error< "expected %0 loop iteration variable">; def err_omp_depend_sink_unexpected_expr : Error< @@ -7980,6 +8598,26 @@ def err_omp_schedule_nonmonotonic_ordered : Error< "'schedule' clause with 'nonmonotonic' modifier cannot be specified if an 'ordered' clause is specified">; def err_omp_ordered_simd : Error< "'ordered' clause with a parameter can not be specified in '#pragma omp %0' directive">; +def err_omp_variable_in_given_clause_and_dsa : Error< + "%0 variable cannot be in a %1 clause in '#pragma omp %2' directive">; +def err_omp_param_or_this_in_clause : Error< + "expected reference to one of the parameters of function %0%select{| or 'this'}1">; +def err_omp_expected_uniform_param : Error< + "expected a reference to a parameter specified in a 'uniform' clause">; +def err_omp_expected_int_param : Error< + "expected a reference to an integer-typed parameter">; +def err_omp_at_least_one_motion_clause_required : Error< + "expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'">; +def err_omp_usedeviceptr_not_a_pointer : Error< + "expected pointer or reference to pointer in 'use_device_ptr' clause">; +def err_omp_argument_type_isdeviceptr : Error < + "expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'">; +def warn_omp_nesting_simd : Warning< + "OpenMP only allows an ordered construct with the simd clause nested in a simd construct">, + InGroup<SourceUsesOpenMP>; +def err_omp_orphaned_device_directive : Error< + "orphaned 'omp %0' directives are prohibited" + "; perhaps you forget to enclose the directive into a %select{|||target |teams }1region?">; } // end of OpenMP category let CategoryName = "Related Result Type Issue" in { @@ -8004,10 +8642,21 @@ def note_related_result_type_inferred : Note< 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">; +def err_invalid_type_for_program_scope_var : Error< + "the %0 type cannot be used to declare a program scope variable">; } let CategoryName = "Modules Issue" in { +def err_module_interface_implementation_mismatch : Error< + "%select{'module'|'module partition'|'module implementation'}0 declaration " + "found while %select{not |not |}0building module interface">; +def err_current_module_name_mismatch : Error< + "module name '%0' specified on command line does not match name of module">; +def err_module_redefinition : Error< + "redefinition of module '%0'">; +def note_prev_module_definition : Note<"previously defined here">; +def note_prev_module_definition_from_ast_file : Note<"module loaded from '%0'">; def err_module_private_specialization : Error< "%select{template|partial|member}0 specialization cannot be " "declared __module_private__">; @@ -8018,17 +8667,22 @@ def err_module_private_local_class : Error< "local %select{struct|interface|union|class|enum}0 cannot be declared " "__module_private__">; def err_module_unimported_use : Error< - "%select{declaration|definition|default argument}0 of %1 must be imported " + "%select{declaration|definition|default argument|" + "explicit specialization|partial specialization}0 of %1 must be imported " + "from module '%2' before it is required">; +def err_module_unimported_use_header : Error< + "missing '#include %3'; " + "%select{declaration|definition|default argument|" + "explicit specialization|partial specialization}0 of %1 must be imported " "from module '%2' before it is required">; def err_module_unimported_use_multiple : Error< - "%select{declaration|definition|default argument}0 of %1 must be imported " + "%select{declaration|definition|default argument|" + "explicit specialization|partial specialization}0 of %1 must be imported " "from one of the following modules before it is required:%2">; def ext_module_import_in_extern_c : ExtWarn< "import of C++ module '%0' appears within extern \"C\" language linkage " "specification">, DefaultError, InGroup<DiagGroup<"module-import-in-extern-c">>; -def note_module_import_in_extern_c : Note< - "extern \"C\" language linkage specification begins here">; def err_module_import_not_at_top_level_fatal : Error< "import of module '%0' appears within %1">, DefaultFatal; def ext_module_import_not_at_top_level_noop : ExtWarn< @@ -8039,6 +8693,8 @@ def err_module_self_import : Error< "import of module '%0' appears within same top-level module '%1'">; def err_module_import_in_implementation : Error< "@import of module '%0' in implementation of '%1'; use #import">; +def err_export_within_export : Error< + "export declaration appears within another export declaration">; def ext_equivalent_internal_linkage_decl_in_modules : ExtWarn< "ambiguous use of internal linkage declaration %0 defined in multiple modules">, @@ -8059,20 +8715,15 @@ def err_coroutine_unevaluated_context : Error< "'%0' cannot be used in an unevaluated context">; def err_coroutine_outside_function : Error< "'%0' cannot be used outside a function">; -def err_coroutine_ctor_dtor : Error< - "'%1' cannot be used in a %select{constructor|destructor}0">; -def err_coroutine_constexpr : Error< - "'%0' cannot be used in a constexpr function">; -def err_coroutine_varargs : Error< - "'%0' cannot be used in a varargs function">; -def ext_coroutine_without_co_await_co_yield : ExtWarn< - "'co_return' used in a function " - "that uses neither 'co_await' nor 'co_yield'">, - InGroup<DiagGroup<"coreturn-without-coawait">>; +def err_coroutine_invalid_func_context : Error< + "'%1' cannot be used in %select{a constructor|a destructor" + "|a copy assignment operator|a move assignment operator|the 'main' function" + "|a constexpr function|a function with a deduced return type" + "|a varargs function}0">; def err_implied_std_coroutine_traits_not_found : Error< - "you need to include <coroutine> before defining a coroutine">; + "you need to include <experimental/coroutine> before defining a coroutine">; def err_malformed_std_coroutine_traits : Error< - "'std::coroutine_traits' must be a class template">; + "'std::experimental::coroutine_traits' must be a class template">; def err_implied_std_coroutine_traits_promise_type_not_found : Error< "this function cannot be a coroutine: %q0 has no member named 'promise_type'">; def err_implied_std_coroutine_traits_promise_type_not_class : Error< @@ -8080,6 +8731,13 @@ def err_implied_std_coroutine_traits_promise_type_not_class : Error< def err_coroutine_traits_missing_specialization : Error< "this function cannot be a coroutine: missing definition of " "specialization %q0">; +def err_implied_std_current_exception_not_found : Error< + "you need to include <exception> before defining a coroutine that implicitly " + "uses 'set_exception'">; +def err_malformed_std_current_exception : Error< + "'std::current_exception' must be a function">; +def err_coroutine_promise_return_ill_formed : Error< + "%0 declares both 'return_value' and 'return_void'">; } let CategoryName = "Documentation Issue" in { @@ -8136,6 +8794,19 @@ def warn_nullability_missing : Warning< "%select{pointer|block pointer|member pointer}0 is missing a nullability " "type specifier (_Nonnull, _Nullable, or _Null_unspecified)">, InGroup<NullabilityCompleteness>; +def warn_nullability_missing_array : Warning< + "array parameter is missing a nullability type specifier (_Nonnull, " + "_Nullable, or _Null_unspecified)">, + InGroup<NullabilityCompletenessOnArrays>; +def note_nullability_fix_it : Note< + "insert '%select{_Nonnull|_Nullable|_Null_unspecified}0' if the " + "%select{pointer|block pointer|member pointer|array parameter}1 " + "%select{should never be null|may be null|should not declare nullability}0">; + +def warn_nullability_inferred_on_nested_type : Warning< + "inferring '_Nonnull' for pointer type within %select{array|reference}0 is " + "deprecated">, + InGroup<NullabilityInferredOnNestedType>; def err_objc_type_arg_explicit_nullability : Error< "type argument %0 cannot explicitly specify nullability">; @@ -8221,4 +8892,16 @@ def warn_objc_redundant_qualified_class_type : Warning< "parameterized class %0 already conforms to the protocols listed; did you " "forget a '*'?">, InGroup<ObjCProtocolQualifiers>; +def warn_block_literal_attributes_on_omitted_return_type : Warning< + "attribute %0 ignored, because it cannot be applied to omitted return type">, + InGroup<IgnoredAttributes>; + +def warn_block_literal_qualifiers_on_omitted_return_type : Warning< + "'%0' qualifier on omitted return type %1 has no effect">, + InGroup<IgnoredQualifiers>; + +def ext_warn_gnu_final : ExtWarn< + "__final is a GNU extension, consider using C++11 final">, + InGroup<GccCompat>; + } // end of sema component. |