10b57cec5SDimitry Andric//==--- DiagnosticCommentKinds.td - diagnostics related to comments -------===//
20b57cec5SDimitry Andric//
30b57cec5SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric// See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric//
70b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric
90b57cec5SDimitry Andriclet Component = "Comment" in {
100b57cec5SDimitry Andriclet CategoryName = "Documentation Issue" in {
110b57cec5SDimitry Andric
120b57cec5SDimitry Andric// HTML parsing errors.  These are under -Wdocumentation to make sure the user
130b57cec5SDimitry Andric// knows that we didn't parse something as they might expect.
140b57cec5SDimitry Andric
150b57cec5SDimitry Andricdef warn_doc_html_start_tag_expected_quoted_string : Warning<
160b57cec5SDimitry Andric  "expected quoted string after equals sign">,
170b57cec5SDimitry Andric  InGroup<Documentation>, DefaultIgnore;
180b57cec5SDimitry Andric
190b57cec5SDimitry Andricdef warn_doc_html_start_tag_expected_ident_or_greater : Warning<
200b57cec5SDimitry Andric  "HTML start tag prematurely ended, expected attribute name or '>'">,
210b57cec5SDimitry Andric  InGroup<Documentation>, DefaultIgnore;
220b57cec5SDimitry Andric
230b57cec5SDimitry Andricdef note_doc_html_tag_started_here : Note<
240b57cec5SDimitry Andric  "HTML tag started here">;
250b57cec5SDimitry Andric
260b57cec5SDimitry Andric// HTML semantic errors
270b57cec5SDimitry Andric
280b57cec5SDimitry Andricdef warn_doc_html_end_forbidden : Warning<
290b57cec5SDimitry Andric  "HTML end tag '%0' is forbidden">,
300b57cec5SDimitry Andric  InGroup<DocumentationHTML>, DefaultIgnore;
310b57cec5SDimitry Andric
320b57cec5SDimitry Andricdef warn_doc_html_end_unbalanced : Warning<
330b57cec5SDimitry Andric  "HTML end tag does not match any start tag">,
340b57cec5SDimitry Andric  InGroup<DocumentationHTML>, DefaultIgnore;
350b57cec5SDimitry Andric
360b57cec5SDimitry Andricdef warn_doc_html_start_end_mismatch : Warning<
370b57cec5SDimitry Andric  "HTML start tag '%0' closed by '%1'">,
380b57cec5SDimitry Andric  InGroup<DocumentationHTML>, DefaultIgnore;
390b57cec5SDimitry Andric
400b57cec5SDimitry Andricdef note_doc_html_end_tag : Note<
410b57cec5SDimitry Andric  "end tag">;
420b57cec5SDimitry Andric
430b57cec5SDimitry Andricdef warn_doc_html_missing_end_tag : Warning<
440b57cec5SDimitry Andric  "HTML tag '%0' requires an end tag">,
450b57cec5SDimitry Andric  InGroup<DocumentationHTML>, DefaultIgnore;
460b57cec5SDimitry Andric
470b57cec5SDimitry Andric// Commands
480b57cec5SDimitry Andric
490b57cec5SDimitry Andricdef warn_doc_block_command_empty_paragraph : Warning<
500b57cec5SDimitry Andric  "empty paragraph passed to '%select{\\|@}0%1' command">,
510b57cec5SDimitry Andric  InGroup<Documentation>, DefaultIgnore;
520b57cec5SDimitry Andric
530b57cec5SDimitry Andricdef warn_doc_block_command_duplicate : Warning<
540b57cec5SDimitry Andric  "duplicated command '%select{\\|@}0%1'">,
550b57cec5SDimitry Andric  InGroup<Documentation>, DefaultIgnore;
560b57cec5SDimitry Andric
570b57cec5SDimitry Andricdef note_doc_block_command_previous : Note<
580b57cec5SDimitry Andric  "previous command '%select{\\|@}0%1' here">;
590b57cec5SDimitry Andric
600b57cec5SDimitry Andricdef note_doc_block_command_previous_alias : Note<
610b57cec5SDimitry Andric  "previous command '%select{\\|@}0%1' (an alias of '\\%2') here">;
620b57cec5SDimitry Andric
630b57cec5SDimitry Andric// \param command
640b57cec5SDimitry Andric
650b57cec5SDimitry Andricdef warn_doc_param_invalid_direction : Warning<
660b57cec5SDimitry Andric  "unrecognized parameter passing direction, "
670b57cec5SDimitry Andric  "valid directions are '[in]', '[out]' and '[in,out]'">,
680b57cec5SDimitry Andric  InGroup<Documentation>, DefaultIgnore;
690b57cec5SDimitry Andric
700b57cec5SDimitry Andricdef warn_doc_param_spaces_in_direction : Warning<
710b57cec5SDimitry Andric  "whitespace is not allowed in parameter passing direction">,
720b57cec5SDimitry Andric  InGroup<DocumentationPedantic>, DefaultIgnore;
730b57cec5SDimitry Andric
740b57cec5SDimitry Andricdef warn_doc_param_not_attached_to_a_function_decl : Warning<
750b57cec5SDimitry Andric  "'%select{\\|@}0param' command used in a comment that is not attached to "
760b57cec5SDimitry Andric  "a function declaration">,
770b57cec5SDimitry Andric  InGroup<Documentation>, DefaultIgnore;
780b57cec5SDimitry Andric
790b57cec5SDimitry Andricdef warn_doc_function_method_decl_mismatch : Warning<
800b57cec5SDimitry Andric  "'%select{\\|@}0%select{function|functiongroup|method|methodgroup|callback}1' "
810b57cec5SDimitry Andric  "command should be used in a comment attached to "
820b57cec5SDimitry Andric  "%select{a function|a function|an Objective-C method|an Objective-C method|"
830b57cec5SDimitry Andric  "a pointer to function}2 declaration">,
840b57cec5SDimitry Andric  InGroup<Documentation>, DefaultIgnore;
850b57cec5SDimitry Andric
860b57cec5SDimitry Andricdef warn_doc_api_container_decl_mismatch : Warning<
870b57cec5SDimitry Andric  "'%select{\\|@}0%select{class|interface|protocol|struct|union}1' "
880b57cec5SDimitry Andric  "command should not be used in a comment attached to a "
890b57cec5SDimitry Andric  "non-%select{class|interface|protocol|struct|union}2 declaration">,
900b57cec5SDimitry Andric  InGroup<Documentation>, DefaultIgnore;
910b57cec5SDimitry Andric
920b57cec5SDimitry Andricdef warn_doc_container_decl_mismatch : Warning<
930b57cec5SDimitry Andric  "'%select{\\|@}0%select{classdesign|coclass|dependency|helper"
940b57cec5SDimitry Andric  "|helperclass|helps|instancesize|ownership|performance|security|superclass}1' "
950b57cec5SDimitry Andric  "command should not be used in a comment attached to a non-container declaration">,
960b57cec5SDimitry Andric  InGroup<Documentation>, DefaultIgnore;
970b57cec5SDimitry Andric
980b57cec5SDimitry Andricdef warn_doc_param_duplicate : Warning<
990b57cec5SDimitry Andric  "parameter '%0' is already documented">,
1000b57cec5SDimitry Andric  InGroup<Documentation>, DefaultIgnore;
1010b57cec5SDimitry Andric
1020b57cec5SDimitry Andricdef note_doc_param_previous : Note<
1030b57cec5SDimitry Andric  "previous documentation">;
1040b57cec5SDimitry Andric
1050b57cec5SDimitry Andricdef warn_doc_param_not_found : Warning<
1060b57cec5SDimitry Andric  "parameter '%0' not found in the function declaration">,
1070b57cec5SDimitry Andric  InGroup<Documentation>, DefaultIgnore;
1080b57cec5SDimitry Andric
1090b57cec5SDimitry Andricdef note_doc_param_name_suggestion : Note<
1100b57cec5SDimitry Andric  "did you mean '%0'?">;
1110b57cec5SDimitry Andric
1120b57cec5SDimitry Andric// tparam command
1130b57cec5SDimitry Andric
1140b57cec5SDimitry Andricdef warn_doc_tparam_not_attached_to_a_template_decl : Warning<
1150b57cec5SDimitry Andric  "'%select{\\|@}0tparam' command used in a comment that is not attached to "
1160b57cec5SDimitry Andric  "a template declaration">,
1170b57cec5SDimitry Andric  InGroup<Documentation>, DefaultIgnore;
1180b57cec5SDimitry Andric
1190b57cec5SDimitry Andricdef warn_doc_tparam_duplicate : Warning<
1200b57cec5SDimitry Andric  "template parameter '%0' is already documented">,
1210b57cec5SDimitry Andric  InGroup<Documentation>, DefaultIgnore;
1220b57cec5SDimitry Andric
1230b57cec5SDimitry Andricdef note_doc_tparam_previous : Note<
1240b57cec5SDimitry Andric  "previous documentation">;
1250b57cec5SDimitry Andric
1260b57cec5SDimitry Andricdef warn_doc_tparam_not_found : Warning<
1270b57cec5SDimitry Andric  "template parameter '%0' not found in the template declaration">,
1280b57cec5SDimitry Andric  InGroup<Documentation>, DefaultIgnore;
1290b57cec5SDimitry Andric
1300b57cec5SDimitry Andricdef note_doc_tparam_name_suggestion : Note<
1310b57cec5SDimitry Andric  "did you mean '%0'?">;
1320b57cec5SDimitry Andric
1330b57cec5SDimitry Andric// \returns command
1340b57cec5SDimitry Andric
1350b57cec5SDimitry Andricdef warn_doc_returns_not_attached_to_a_function_decl : Warning<
1360b57cec5SDimitry Andric  "'%select{\\|@}0%1' command used in a comment that is not attached to "
1370b57cec5SDimitry Andric  "a function or method declaration">,
1380b57cec5SDimitry Andric  InGroup<Documentation>, DefaultIgnore;
1390b57cec5SDimitry Andric
1400b57cec5SDimitry Andricdef warn_doc_returns_attached_to_a_void_function : Warning<
1410b57cec5SDimitry Andric  "'%select{\\|@}0%1' command used in a comment that is attached to a "
1420b57cec5SDimitry Andric  "%select{function returning void|constructor|destructor|"
1430b57cec5SDimitry Andric  "method returning void}2">,
1440b57cec5SDimitry Andric  InGroup<Documentation>, DefaultIgnore;
1450b57cec5SDimitry Andric
1460b57cec5SDimitry Andric// \deprecated command
1470b57cec5SDimitry Andric
1480b57cec5SDimitry Andricdef warn_doc_deprecated_not_sync : Warning<
149480093f4SDimitry Andric  "declaration is marked with '%select{\\|@}0deprecated' command but does "
150480093f4SDimitry Andric  "not have a deprecation attribute">,
1510b57cec5SDimitry Andric  InGroup<DocumentationDeprecatedSync>, DefaultIgnore;
1520b57cec5SDimitry Andric
1530b57cec5SDimitry Andricdef note_add_deprecation_attr : Note<
1540b57cec5SDimitry Andric  "add a deprecation attribute to the declaration to silence this warning">;
1550b57cec5SDimitry Andric
156a7dea167SDimitry Andric// inline contents commands
157a7dea167SDimitry Andric
15881ad6265SDimitry Andricdef warn_doc_inline_command_not_enough_arguments : Warning<
15981ad6265SDimitry Andric  "'%select{\\|@}0%1' command has %plural{0:no|:%2}2 word argument%s2, expected %3">,
160a7dea167SDimitry Andric  InGroup<Documentation>, DefaultIgnore;
161a7dea167SDimitry Andric
1620b57cec5SDimitry Andric// verbatim block commands
1630b57cec5SDimitry Andric
1640b57cec5SDimitry Andricdef warn_verbatim_block_end_without_start : Warning<
1650b57cec5SDimitry Andric  "'%select{\\|@}0%1' command does not terminate a verbatim text block">,
1660b57cec5SDimitry Andric  InGroup<Documentation>, DefaultIgnore;
1670b57cec5SDimitry Andric
1680b57cec5SDimitry Andricdef warn_unknown_comment_command_name : Warning<
1690b57cec5SDimitry Andric  "unknown command tag name">,
1700b57cec5SDimitry Andric  InGroup<DocumentationUnknownCommand>, DefaultIgnore;
1710b57cec5SDimitry Andric
1720b57cec5SDimitry Andricdef warn_correct_comment_command_name : Warning<
1730b57cec5SDimitry Andric  "unknown command tag name '%0'; did you mean '%1'?">,
1740b57cec5SDimitry Andric  InGroup<DocumentationUnknownCommand>, DefaultIgnore;
1750b57cec5SDimitry Andric
1760b57cec5SDimitry Andric} // end of documentation issue category
1770b57cec5SDimitry Andric} // end of AST component
178