1 //==--- DiagnosticCommentKinds.td - diagnostics related to comments -------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 let Component = "Comment" in {
11 let CategoryName = "Documentation Issue" in {
13 // HTML parsing errors. These are under -Wdocumentation to make sure the user
14 // knows that we didn't parse something as they might expect.
16 def warn_doc_html_start_tag_expected_quoted_string : Warning<
17 "expected quoted string after equals sign">,
18 InGroup<Documentation>, DefaultIgnore;
20 def warn_doc_html_start_tag_expected_ident_or_greater : Warning<
21 "HTML start tag prematurely ended, expected attribute name or '>'">,
22 InGroup<Documentation>, DefaultIgnore;
24 def note_doc_html_tag_started_here : Note<
25 "HTML tag started here">;
27 // HTML semantic errors
29 def warn_doc_html_end_forbidden : Warning<
30 "HTML end tag '%0' is forbidden">,
31 InGroup<DocumentationHTML>, DefaultIgnore;
33 def warn_doc_html_end_unbalanced : Warning<
34 "HTML end tag does not match any start tag">,
35 InGroup<DocumentationHTML>, DefaultIgnore;
37 def warn_doc_html_start_end_mismatch : Warning<
38 "HTML start tag '%0' closed by '%1'">,
39 InGroup<DocumentationHTML>, DefaultIgnore;
41 def note_doc_html_end_tag : Note<
44 def warn_doc_html_missing_end_tag : Warning<
45 "HTML tag '%0' requires an end tag">,
46 InGroup<DocumentationHTML>, DefaultIgnore;
50 def warn_doc_block_command_empty_paragraph : Warning<
51 "empty paragraph passed to '%select{\\|@}0%1' command">,
52 InGroup<Documentation>, DefaultIgnore;
54 def warn_doc_block_command_duplicate : Warning<
55 "duplicated command '%select{\\|@}0%1'">,
56 InGroup<Documentation>, DefaultIgnore;
58 def note_doc_block_command_previous : Note<
59 "previous command '%select{\\|@}0%1' here">;
61 def note_doc_block_command_previous_alias : Note<
62 "previous command '%select{\\|@}0%1' (an alias of '\\%2') here">;
66 def warn_doc_param_invalid_direction : Warning<
67 "unrecognized parameter passing direction, "
68 "valid directions are '[in]', '[out]' and '[in,out]'">,
69 InGroup<Documentation>, DefaultIgnore;
71 def warn_doc_param_spaces_in_direction : Warning<
72 "whitespace is not allowed in parameter passing direction">,
73 InGroup<DocumentationPedantic>, DefaultIgnore;
75 def warn_doc_param_not_attached_to_a_function_decl : Warning<
76 "'%select{\\|@}0param' command used in a comment that is not attached to "
77 "a function declaration">,
78 InGroup<Documentation>, DefaultIgnore;
80 def warn_doc_function_method_decl_mismatch : Warning<
81 "'%select{\\|@}0%select{function|functiongroup|method|methodgroup|callback}1' "
82 "command should be used in a comment attached to "
83 "%select{a function|a function|an Objective-C method|an Objective-C method|"
84 "a pointer to function}2 declaration">,
85 InGroup<Documentation>, DefaultIgnore;
87 def warn_doc_api_container_decl_mismatch : Warning<
88 "'%select{\\|@}0%select{class|interface|protocol|struct|union}1' "
89 "command should not be used in a comment attached to a "
90 "non-%select{class|interface|protocol|struct|union}2 declaration">,
91 InGroup<Documentation>, DefaultIgnore;
93 def warn_doc_container_decl_mismatch : Warning<
94 "'%select{\\|@}0%select{classdesign|coclass|dependency|helper"
95 "|helperclass|helps|instancesize|ownership|performance|security|superclass}1' "
96 "command should not be used in a comment attached to a non-container declaration">,
97 InGroup<Documentation>, DefaultIgnore;
99 def warn_doc_param_duplicate : Warning<
100 "parameter '%0' is already documented">,
101 InGroup<Documentation>, DefaultIgnore;
103 def note_doc_param_previous : Note<
104 "previous documentation">;
106 def warn_doc_param_not_found : Warning<
107 "parameter '%0' not found in the function declaration">,
108 InGroup<Documentation>, DefaultIgnore;
110 def note_doc_param_name_suggestion : Note<
111 "did you mean '%0'?">;
115 def warn_doc_tparam_not_attached_to_a_template_decl : Warning<
116 "'%select{\\|@}0tparam' command used in a comment that is not attached to "
117 "a template declaration">,
118 InGroup<Documentation>, DefaultIgnore;
120 def warn_doc_tparam_duplicate : Warning<
121 "template parameter '%0' is already documented">,
122 InGroup<Documentation>, DefaultIgnore;
124 def note_doc_tparam_previous : Note<
125 "previous documentation">;
127 def warn_doc_tparam_not_found : Warning<
128 "template parameter '%0' not found in the template declaration">,
129 InGroup<Documentation>, DefaultIgnore;
131 def note_doc_tparam_name_suggestion : Note<
132 "did you mean '%0'?">;
136 def warn_doc_returns_not_attached_to_a_function_decl : Warning<
137 "'%select{\\|@}0%1' command used in a comment that is not attached to "
138 "a function or method declaration">,
139 InGroup<Documentation>, DefaultIgnore;
141 def warn_doc_returns_attached_to_a_void_function : Warning<
142 "'%select{\\|@}0%1' command used in a comment that is attached to a "
143 "%select{function returning void|constructor|destructor|"
144 "method returning void}2">,
145 InGroup<Documentation>, DefaultIgnore;
147 // \deprecated command
149 def warn_doc_deprecated_not_sync : Warning<
150 "declaration is marked with '\\deprecated' command but does not have "
151 "a deprecation attribute">,
152 InGroup<DocumentationDeprecatedSync>, DefaultIgnore;
154 def note_add_deprecation_attr : Note<
155 "add a deprecation attribute to the declaration to silence this warning">;
157 // verbatim block commands
159 def warn_verbatim_block_end_without_start : Warning<
160 "'%select{\\|@}0%1' command does not terminate a verbatim text block">,
161 InGroup<Documentation>, DefaultIgnore;
163 def warn_unknown_comment_command_name : Warning<
164 "unknown command tag name">,
165 InGroup<DocumentationUnknownCommand>, DefaultIgnore;
167 def warn_correct_comment_command_name : Warning<
168 "unknown command tag name '%0'; did you mean '%1'?">,
169 InGroup<DocumentationUnknownCommand>, DefaultIgnore;
171 } // end of documentation issue category
172 } // end of AST component