1//==--- DiagnosticCommentKinds.td - diagnostics related to comments -------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9let Component = "Comment" in {
10let CategoryName = "Documentation Issue" in {
11
12// HTML parsing errors. These are under -Wdocumentation to make sure the user
13// knows that we didn't parse something as they might expect.
14
15def warn_doc_html_start_tag_expected_quoted_string : Warning<
16 "expected quoted string after equals sign">,
17 InGroup<Documentation>, DefaultIgnore;
18
19def warn_doc_html_start_tag_expected_ident_or_greater : Warning<
20 "HTML start tag prematurely ended, expected attribute name or '>'">,
21 InGroup<Documentation>, DefaultIgnore;
22
23def note_doc_html_tag_started_here : Note<
24 "HTML tag started here">;
25
26// HTML semantic errors
27
28def warn_doc_html_end_forbidden : Warning<
29 "HTML end tag '%0' is forbidden">,
30 InGroup<DocumentationHTML>, DefaultIgnore;
31
32def warn_doc_html_end_unbalanced : Warning<
33 "HTML end tag does not match any start tag">,
34 InGroup<DocumentationHTML>, DefaultIgnore;
35
36def warn_doc_html_start_end_mismatch : Warning<
37 "HTML start tag '%0' closed by '%1'">,
38 InGroup<DocumentationHTML>, DefaultIgnore;
39
40def note_doc_html_end_tag : Note<
41 "end tag">;
42
43def warn_doc_html_missing_end_tag : Warning<
44 "HTML tag '%0' requires an end tag">,
45 InGroup<DocumentationHTML>, DefaultIgnore;
46
47// Commands
48
49def warn_doc_block_command_empty_paragraph : Warning<
50 "empty paragraph passed to '%select{\\|@}0%1' command">,
51 InGroup<Documentation>, DefaultIgnore;
52
53def warn_doc_block_command_duplicate : Warning<
54 "duplicated command '%select{\\|@}0%1'">,
55 InGroup<Documentation>, DefaultIgnore;
56
57def note_doc_block_command_previous : Note<
58 "previous command '%select{\\|@}0%1' here">;
59
60def note_doc_block_command_previous_alias : Note<
61 "previous command '%select{\\|@}0%1' (an alias of '\\%2') here">;
62
63// \param command
64
65def warn_doc_param_invalid_direction : Warning<
66 "unrecognized parameter passing direction, "
67 "valid directions are '[in]', '[out]' and '[in,out]'">,
68 InGroup<Documentation>, DefaultIgnore;
69
70def warn_doc_param_spaces_in_direction : Warning<
71 "whitespace is not allowed in parameter passing direction">,
72 InGroup<DocumentationPedantic>, DefaultIgnore;
73
74def warn_doc_param_not_attached_to_a_function_decl : Warning<
75 "'%select{\\|@}0param' command used in a comment that is not attached to "
76 "a function declaration">,
77 InGroup<Documentation>, DefaultIgnore;
78
79def warn_doc_function_method_decl_mismatch : Warning<
80 "'%select{\\|@}0%select{function|functiongroup|method|methodgroup|callback}1' "
81 "command should be used in a comment attached to "
82 "%select{a function|a function|an Objective-C method|an Objective-C method|"
83 "a pointer to function}2 declaration">,
84 InGroup<Documentation>, DefaultIgnore;
85
86def warn_doc_api_container_decl_mismatch : Warning<
87 "'%select{\\|@}0%select{class|interface|protocol|struct|union}1' "
88 "command should not be used in a comment attached to a "
89 "non-%select{class|interface|protocol|struct|union}2 declaration">,
90 InGroup<Documentation>, DefaultIgnore;
91
92def warn_doc_container_decl_mismatch : Warning<
93 "'%select{\\|@}0%select{classdesign|coclass|dependency|helper"
94 "|helperclass|helps|instancesize|ownership|performance|security|superclass}1' "
95 "command should not be used in a comment attached to a non-container declaration">,
96 InGroup<Documentation>, DefaultIgnore;
97
98def warn_doc_param_duplicate : Warning<
99 "parameter '%0' is already documented">,
100 InGroup<Documentation>, DefaultIgnore;
101
102def note_doc_param_previous : Note<
103 "previous documentation">;
104
105def warn_doc_param_not_found : Warning<
106 "parameter '%0' not found in the function declaration">,
107 InGroup<Documentation>, DefaultIgnore;
108
109def note_doc_param_name_suggestion : Note<
110 "did you mean '%0'?">;
111
112// tparam command
113
114def warn_doc_tparam_not_attached_to_a_template_decl : Warning<
115 "'%select{\\|@}0tparam' command used in a comment that is not attached to "
116 "a template declaration">,
117 InGroup<Documentation>, DefaultIgnore;
118
119def warn_doc_tparam_duplicate : Warning<
120 "template parameter '%0' is already documented">,
121 InGroup<Documentation>, DefaultIgnore;
122
123def note_doc_tparam_previous : Note<
124 "previous documentation">;
125
126def warn_doc_tparam_not_found : Warning<
127 "template parameter '%0' not found in the template declaration">,
128 InGroup<Documentation>, DefaultIgnore;
129
130def note_doc_tparam_name_suggestion : Note<
131 "did you mean '%0'?">;
132
133// \returns command
134
135def warn_doc_returns_not_attached_to_a_function_decl : Warning<
136 "'%select{\\|@}0%1' command used in a comment that is not attached to "
137 "a function or method declaration">,
138 InGroup<Documentation>, DefaultIgnore;
139
140def warn_doc_returns_attached_to_a_void_function : Warning<
141 "'%select{\\|@}0%1' command used in a comment that is attached to a "
142 "%select{function returning void|constructor|destructor|"
143 "method returning void}2">,
144 InGroup<Documentation>, DefaultIgnore;
145
146// \deprecated command
147
148def warn_doc_deprecated_not_sync : Warning<
149 "declaration is marked with '%select{\\|@}0deprecated' command but does "
150 "not have a deprecation attribute">,
151 InGroup<DocumentationDeprecatedSync>, DefaultIgnore;
152
153def note_add_deprecation_attr : Note<
154 "add a deprecation attribute to the declaration to silence this warning">;
155
156// inline contents commands
157
158def warn_doc_inline_contents_no_argument : Warning<
159 "'%select{\\|@}0%1' command does not have a valid word argument">,
160 InGroup<Documentation>, DefaultIgnore;
161
162// verbatim block commands
163
164def warn_verbatim_block_end_without_start : Warning<
165 "'%select{\\|@}0%1' command does not terminate a verbatim text block">,
166 InGroup<Documentation>, DefaultIgnore;
167
168def warn_unknown_comment_command_name : Warning<
169 "unknown command tag name">,
170 InGroup<DocumentationUnknownCommand>, DefaultIgnore;
171
172def warn_correct_comment_command_name : Warning<
173 "unknown command tag name '%0'; did you mean '%1'?">,
174 InGroup<DocumentationUnknownCommand>, DefaultIgnore;
175
176} // end of documentation issue category
177} // end of AST component
178