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 he 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<
46 def warn_doc_block_command_empty_paragraph : Warning<
47 "empty paragraph passed to '%select{\\|@}0%1' command">,
48 InGroup<Documentation>, DefaultIgnore;
50 def warn_doc_block_command_duplicate : Warning<
51 "duplicated command '%select{\\|@}0%1'">,
52 InGroup<Documentation>, DefaultIgnore;
54 def note_doc_block_command_previous : Note<
55 "previous command '%select{\\|@}0%1' here">;
57 def note_doc_block_command_previous_alias : Note<
58 "previous command '%select{\\|@}0%1' (an alias of '\\%2') here">;
62 def warn_doc_param_invalid_direction : Warning<
63 "unrecognized parameter passing direction, "
64 "valid directions are '[in]', '[out]' and '[in,out]'">,
65 InGroup<Documentation>, DefaultIgnore;
67 def warn_doc_param_spaces_in_direction : Warning<
68 "whitespace is not allowed in parameter passing direction">,
69 InGroup<DocumentationPedantic>, DefaultIgnore;
71 def warn_doc_param_not_attached_to_a_function_decl : Warning<
72 "'%select{\\|@}0param' command used in a comment that is not attached to "
73 "a function declaration">,
74 InGroup<Documentation>, DefaultIgnore;
76 def warn_doc_function_method_decl_mismatch : Warning<
77 "'%select{\\|@}0%select{function|functiongroup|method|methodgroup|callback}1' "
78 "command should be used in a comment attached to "
79 "%select{a function|a function|an Objective-C method|an Objective-C method|"
80 "a pointer to function}2 declaration">,
81 InGroup<Documentation>, DefaultIgnore;
83 def warn_doc_api_container_decl_mismatch : Warning<
84 "'%select{\\|@}0%select{class|interface|protocol|struct|union}1' "
85 "command should not be used in a comment attached to a "
86 "non-%select{class|interface|protocol|struct|union}2 declaration">,
87 InGroup<Documentation>, DefaultIgnore;
89 def warn_doc_container_decl_mismatch : Warning<
90 "'%select{\\|@}0%select{classdesign|coclass|dependency|helper"
91 "|helperclass|helps|instancesize|ownership|performance|security|superclass}1' "
92 "command should not be used in a comment attached to a non-container declaration">,
93 InGroup<Documentation>, DefaultIgnore;
95 def warn_doc_param_duplicate : Warning<
96 "parameter '%0' is already documented">,
97 InGroup<Documentation>, DefaultIgnore;
99 def note_doc_param_previous : Note<
100 "previous documentation">;
102 def warn_doc_param_not_found : Warning<
103 "parameter '%0' not found in the function declaration">,
104 InGroup<Documentation>, DefaultIgnore;
106 def note_doc_param_name_suggestion : Note<
107 "did you mean '%0'?">;
111 def warn_doc_tparam_not_attached_to_a_template_decl : Warning<
112 "'%select{\\|@}0tparam' command used in a comment that is not attached to "
113 "a template declaration">,
114 InGroup<Documentation>, DefaultIgnore;
116 def warn_doc_tparam_duplicate : Warning<
117 "template parameter '%0' is already documented">,
118 InGroup<Documentation>, DefaultIgnore;
120 def note_doc_tparam_previous : Note<
121 "previous documentation">;
123 def warn_doc_tparam_not_found : Warning<
124 "template parameter '%0' not found in the template declaration">,
125 InGroup<Documentation>, DefaultIgnore;
127 def note_doc_tparam_name_suggestion : Note<
128 "did you mean '%0'?">;
132 def warn_doc_returns_not_attached_to_a_function_decl : Warning<
133 "'%select{\\|@}0%1' command used in a comment that is not attached to "
134 "a function or method declaration">,
135 InGroup<Documentation>, DefaultIgnore;
137 def warn_doc_returns_attached_to_a_void_function : Warning<
138 "'%select{\\|@}0%1' command used in a comment that is attached to a "
139 "%select{function returning void|constructor|destructor|"
140 "method returning void}2">,
141 InGroup<Documentation>, DefaultIgnore;
143 // \deprecated command
145 def warn_doc_deprecated_not_sync : Warning<
146 "declaration is marked with '\\deprecated' command but does not have "
147 "a deprecation attribute">,
148 InGroup<DocumentationDeprecatedSync>, DefaultIgnore;
150 def note_add_deprecation_attr : Note<
151 "add a deprecation attribute to the declaration to silence this warning">;
153 // verbatim block commands
155 def warn_verbatim_block_end_without_start : Warning<
156 "'%select{\\|@}0%1' command does not terminate a verbatim text block">,
157 InGroup<Documentation>, DefaultIgnore;
159 def warn_unknown_comment_command_name : Warning<
160 "unknown command tag name">,
161 InGroup<DocumentationUnknownCommand>, DefaultIgnore;
163 def warn_correct_comment_command_name : Warning<
164 "unknown command tag name '%0'; did you mean '%1'?">,
165 InGroup<Documentation>, DefaultIgnore;
167 } // end of documentation issue category
168 } // end of AST component