• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//==--- DiagnosticCommonKinds.td - common diagnostics ---------------------===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10//===----------------------------------------------------------------------===//
11// Common Helpers
12//===----------------------------------------------------------------------===//
13
14let Component = "Common" in {
15
16// Basic.
17
18def fatal_too_many_errors
19  : Error<"too many errors emitted, stopping now">, DefaultFatal;
20
21def note_declared_at : Note<"declared here">;
22def note_previous_definition : Note<"previous definition is here">;
23def note_previous_declaration : Note<"previous declaration is here">;
24def note_previous_implicit_declaration : Note<
25  "previous implicit declaration is here">;
26def note_previous_use : Note<"previous use is here">;
27def note_duplicate_case_prev : Note<"previous case defined here">;
28def note_forward_declaration : Note<"forward declaration of %0">;
29def note_type_being_defined : Note<
30  "definition of %0 is not complete until the closing '}'">;
31/// note_matching - this is used as a continuation of a previous diagnostic,
32/// e.g. to specify the '(' when we expected a ')'.
33def note_matching : Note<"to match this %0">;
34
35def note_using : Note<"using">;
36def note_possibility : Note<"one possibility">;
37def note_also_found : Note<"also found">;
38
39// Parse && Lex
40
41let CategoryName = "Lexical or Preprocessor Issue" in {
42
43def err_expected_colon_after_setter_name : Error<
44  "method name referenced in property setter attribute "
45  "must end with ':'">;
46def err_expected_string_literal : Error<"expected string literal "
47  "%select{in %1|for diagnostic message in static_assert|"
48          "for optional message in 'availability' attribute}0">;
49def err_invalid_string_udl : Error<
50  "string literal with user-defined suffix cannot be used here">;
51def err_invalid_character_udl : Error<
52  "character literal with user-defined suffix cannot be used here">;
53def err_invalid_numeric_udl : Error<
54  "numeric literal with user-defined suffix cannot be used here">;
55
56}
57
58// Parse && Sema
59
60let CategoryName = "Parse Issue" in {
61
62def err_expected : Error<"expected %0">;
63def err_expected_either : Error<"expected %0 or %1">;
64def err_expected_after : Error<"expected %1 after %0">;
65
66def err_param_redefinition : Error<"redefinition of parameter %0">;
67def warn_method_param_redefinition : Warning<"redefinition of method parameter %0">;
68def warn_method_param_declaration : Warning<"redeclaration of method parameter %0">,
69  InGroup<DuplicateArgDecl>, DefaultIgnore;
70def err_invalid_storage_class_in_func_decl : Error<
71  "invalid storage class specifier in function declarator">;
72def err_expected_namespace_name : Error<"expected namespace name">;
73def ext_variadic_templates : ExtWarn<
74  "variadic templates are a C++11 extension">, InGroup<CXX11>;
75def warn_cxx98_compat_variadic_templates :
76  Warning<"variadic templates are incompatible with C++98">,
77  InGroup<CXX98Compat>, DefaultIgnore;
78def err_default_special_members : Error<
79  "only special member functions may be defaulted">;
80def err_deleted_non_function : Error<
81  "only functions can have deleted definitions">;
82def err_module_not_found : Error<"module '%0' not found">, DefaultFatal;
83def err_module_not_built : Error<"could not build module '%0'">, DefaultFatal;
84def err_module_build_disabled: Error<
85  "module '%0' is needed but has not been provided, and implicit use of module "
86  "files is disabled">, DefaultFatal;
87def err_module_unavailable : Error<
88  "module '%0' %select{is incompatible with|requires}1 feature '%2'">;
89def err_module_header_missing : Error<
90  "%select{|umbrella }0header '%1' not found">;
91def err_module_lock_failure : Error<
92  "could not acquire lock file for module '%0': %1">, DefaultFatal;
93def err_module_lock_timeout : Error<
94  "timed out waiting to acquire lock file for module '%0'">, DefaultFatal;
95def err_module_cycle : Error<"cyclic dependency in module '%0': %1">,
96  DefaultFatal;
97def note_pragma_entered_here : Note<"#pragma entered here">;
98def note_decl_hiding_tag_type : Note<
99  "%1 %0 is hidden by a non-type declaration of %0 here">;
100def err_attribute_not_type_attr : Error<
101  "%0 attribute cannot be applied to types">;
102def err_enum_template : Error<"enumeration cannot be a template">;
103
104}
105
106let CategoryName = "Nullability Issue" in {
107
108def warn_nullability_duplicate : Warning<
109  "duplicate nullability specifier %0">,
110  InGroup<Nullability>;
111
112def warn_conflicting_nullability_attr_overriding_ret_types : Warning<
113  "conflicting nullability specifier on return types, %0 "
114  "conflicts with existing specifier %1">,
115  InGroup<Nullability>;
116
117def warn_conflicting_nullability_attr_overriding_param_types : Warning<
118  "conflicting nullability specifier on parameter types, %0 "
119  "conflicts with existing specifier %1">,
120  InGroup<Nullability>;
121
122def err_nullability_conflicting : Error<
123  "nullability specifier %0 conflicts with existing specifier %1">;
124
125}
126
127// Sema && Lex
128def ext_c99_longlong : Extension<
129  "'long long' is an extension when C99 mode is not enabled">,
130  InGroup<LongLong>;
131def ext_cxx11_longlong : Extension<
132  "'long long' is a C++11 extension">,
133  InGroup<CXX11LongLong>;
134def warn_cxx98_compat_longlong : Warning<
135  "'long long' is incompatible with C++98">,
136  InGroup<CXX98CompatPedantic>, DefaultIgnore;
137def err_integer_literal_too_large : Error<
138  "integer literal is too large to be represented in any %select{signed |}0"
139  "integer type">;
140def ext_integer_literal_too_large_for_signed : ExtWarn<
141  "integer literal is too large to be represented in a signed integer type, "
142  "interpreting as unsigned">,
143  InGroup<ImplicitlyUnsignedLiteral>;
144def warn_old_implicitly_unsigned_long : Warning<
145  "integer literal is too large to be represented in type 'long', "
146  "interpreting as 'unsigned long' per C89; this literal will "
147  "%select{have type 'long long'|be ill-formed}0 in C99 onwards">,
148  InGroup<C99Compat>;
149def warn_old_implicitly_unsigned_long_cxx : Warning<
150  "integer literal is too large to be represented in type 'long', "
151  "interpreting as 'unsigned long' per C++98; this literal will "
152  "%select{have type 'long long'|be ill-formed}0 in C++11 onwards">,
153  InGroup<CXX11Compat>;
154def ext_old_implicitly_unsigned_long_cxx : ExtWarn<
155  "integer literal is too large to be represented in type 'long' and is "
156  "subject to undefined behavior under C++98, interpreting as 'unsigned long'; "
157  "this literal will %select{have type 'long long'|be ill-formed}0 "
158  "in C++11 onwards">,
159  InGroup<CXX11Compat>;
160def ext_clang_enable_if : Extension<"'enable_if' is a clang extension">,
161                          InGroup<GccCompat>;
162
163// SEH
164def err_seh_expected_handler : Error<
165  "expected '__except' or '__finally' block">;
166def err_seh___except_block : Error<
167  "%0 only allowed in __except block or filter expression">;
168def err_seh___except_filter : Error<
169  "%0 only allowed in __except filter expression">;
170def err_seh___finally_block : Error<
171  "%0 only allowed in __finally block">;
172
173// Sema && AST
174def note_invalid_subexpr_in_const_expr : Note<
175  "subexpression not valid in a constant expression">;
176
177// Targets
178
179def err_target_unknown_triple : Error<
180  "unknown target triple '%0', please use -triple or -arch">;
181def err_target_unknown_cpu : Error<"unknown target CPU '%0'">;
182def err_target_unknown_abi : Error<"unknown target ABI '%0'">;
183def err_target_unsupported_abi : Error<"ABI '%0' is not supported on CPU '%1'">;
184def err_target_unsupported_abi_for_triple : Error<
185  "ABI '%0' is not supported for '%1'">;
186def err_target_unknown_fpmath : Error<"unknown FP unit '%0'">;
187def err_target_unsupported_fpmath : Error<
188    "the '%0' unit is not supported with this instruction set">;
189def err_target_unsupported_unaligned : Error<
190  "the %0 sub-architecture does not support unaligned accesses">;
191def err_opt_not_valid_with_opt : Error<
192  "option '%0' cannot be specified with '%1'">;
193
194// Source manager
195def err_cannot_open_file : Error<"cannot open file '%0': %1">, DefaultFatal;
196def err_file_modified : Error<
197  "file '%0' modified since it was first processed">, DefaultFatal;
198def err_unsupported_bom : Error<"%0 byte order mark detected in '%1', but "
199  "encoding is not supported">, DefaultFatal;
200def err_unable_to_rename_temp : Error<
201  "unable to rename temporary '%0' to output file '%1': '%2'">;
202def err_unable_to_make_temp : Error<
203  "unable to make temporary file: %0">;
204
205// Modules
206def err_module_format_unhandled : Error<
207  "no handler registered for module format '%0'">, DefaultFatal;
208
209// TransformActions
210// TODO: Use a custom category name to distinguish rewriter errors.
211def err_mt_message : Error<"[rewriter] %0">, SuppressInSystemHeader;
212def warn_mt_message : Warning<"[rewriter] %0">;
213def note_mt_message : Note<"[rewriter] %0">;
214
215// ARCMigrate
216def warn_arcmt_nsalloc_realloc : Warning<"[rewriter] call returns pointer to GC managed memory; it will become unmanaged in ARC">;
217def err_arcmt_nsinvocation_ownership : Error<"NSInvocation's %0 is not safe to be used with an object with ownership other than __unsafe_unretained">;
218
219// OpenMP
220def err_omp_more_one_clause : Error<
221  "directive '#pragma omp %0' cannot contain more than one '%1' clause%select{| with '%3' name modifier| with 'source' dependence}2">;
222}
223