1 //==--- DiagnosticCommentKinds.td - diagnostics related to comments -------===//
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
7 //===----------------------------------------------------------------------===//
9 let Component = "Comment" in {
10 let CategoryName = "Documentation Issue" in {
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.
15 def warn_doc_html_start_tag_expected_quoted_string : Warning<
16 "expected quoted string after equals sign">,
17 InGroup<Documentation>, DefaultIgnore;
19 def warn_doc_html_start_tag_expected_ident_or_greater : Warning<
20 "HTML start tag prematurely ended, expected attribute name or '>'">,
21 InGroup<Documentation>, DefaultIgnore;
23 def note_doc_html_tag_started_here : Note<
24 "HTML tag started here">;
26 // HTML semantic errors
28 def warn_doc_html_end_forbidden : Warning<
29 "HTML end tag '%0' is forbidden">,
30 InGroup<DocumentationHTML>, DefaultIgnore;
32 def warn_doc_html_end_unbalanced : Warning<
33 "HTML end tag does not match any start tag">,
34 InGroup<DocumentationHTML>, DefaultIgnore;
36 def warn_doc_html_start_end_mismatch : Warning<
37 "HTML start tag '%0' closed by '%1'">,
38 InGroup<DocumentationHTML>, DefaultIgnore;
40 def note_doc_html_end_tag : Note<
43 def warn_doc_html_missing_end_tag : Warning<
44 "HTML tag '%0' requires an end tag">,
45 InGroup<DocumentationHTML>, DefaultIgnore;
49 def warn_doc_block_command_empty_paragraph : Warning<
50 "empty paragraph passed to '%select{\\|@}0%1' command">,
51 InGroup<Documentation>, DefaultIgnore;
53 def warn_doc_block_command_duplicate : Warning<
54 "duplicated command '%select{\\|@}0%1'">,
55 InGroup<Documentation>, DefaultIgnore;
57 def note_doc_block_command_previous : Note<
58 "previous command '%select{\\|@}0%1' here">;
60 def note_doc_block_command_previous_alias : Note<
61 "previous command '%select{\\|@}0%1' (an alias of '\\%2') here">;
65 def warn_doc_param_invalid_direction : Warning<
66 "unrecognized parameter passing direction, "
67 "valid directions are '[in]', '[out]' and '[in,out]'">,
68 InGroup<Documentation>, DefaultIgnore;
70 def warn_doc_param_spaces_in_direction : Warning<
71 "whitespace is not allowed in parameter passing direction">,
72 InGroup<DocumentationPedantic>, DefaultIgnore;
74 def 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;
79 def 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;
86 def 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;
92 def 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;
98 def warn_doc_param_duplicate : Warning<
99 "parameter '%0' is already documented">,
100 InGroup<Documentation>, DefaultIgnore;
102 def note_doc_param_previous : Note<
103 "previous documentation">;
105 def warn_doc_param_not_found : Warning<
106 "parameter '%0' not found in the function declaration">,
107 InGroup<Documentation>, DefaultIgnore;
109 def note_doc_param_name_suggestion : Note<
110 "did you mean '%0'?">;
114 def 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;
119 def warn_doc_tparam_duplicate : Warning<
120 "template parameter '%0' is already documented">,
121 InGroup<Documentation>, DefaultIgnore;
123 def note_doc_tparam_previous : Note<
124 "previous documentation">;
126 def warn_doc_tparam_not_found : Warning<
127 "template parameter '%0' not found in the template declaration">,
128 InGroup<Documentation>, DefaultIgnore;
130 def note_doc_tparam_name_suggestion : Note<
131 "did you mean '%0'?">;
135 def 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;
140 def 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;
146 // \deprecated command
148 def 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;
153 def note_add_deprecation_attr : Note<
154 "add a deprecation attribute to the declaration to silence this warning">;
156 // inline contents commands
158 def warn_doc_inline_command_not_enough_arguments : Warning<
159 "'%select{\\|@}0%1' command has %plural{0:no|:%2}2 word argument%s2, expected %3">,
160 InGroup<Documentation>, DefaultIgnore;
162 // verbatim block commands
164 def warn_verbatim_block_end_without_start : Warning<
165 "'%select{\\|@}0%1' command does not terminate a verbatim text block">,
166 InGroup<Documentation>, DefaultIgnore;
168 def warn_unknown_comment_command_name : Warning<
169 "unknown command tag name">,
170 InGroup<DocumentationUnknownCommand>, DefaultIgnore;
172 def warn_correct_comment_command_name : Warning<
173 "unknown command tag name '%0'; did you mean '%1'?">,
174 InGroup<DocumentationUnknownCommand>, DefaultIgnore;
176 } // end of documentation issue category
177 } // end of AST component