1 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -Wdocumentation -Wdocumentation-pedantic -verify %s
3 // This file contains lots of corner cases, so ensure that XML we generate is not invalid.
4 // RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng %s | FileCheck %s -check-prefix=WRONG
5 // WRONG-NOT: CommentXMLInvalid
7 // expected-warning@+2 {{HTML tag 'a' requires an end tag}}
8 // expected-warning@+1 {{expected quoted string after equals sign}}
12 // expected-warning@+2 {{HTML tag 'a' requires an end tag}}
13 // expected-warning@+1 {{expected quoted string after equals sign}}
17 // expected-warning@+3 {{HTML tag 'a' requires an end tag}}
18 // expected-warning@+2 {{expected quoted string after equals sign}}
19 // expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}
23 // expected-warning@+2 {{HTML tag 'a' requires an end tag}}
24 // expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}
28 // expected-warning@+2 {{HTML tag 'a' requires an end tag}}
29 // expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}
33 // expected-warning@+2 {{HTML tag 'a' requires an end tag}}
34 // expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}
38 // expected-warning@+2 {{HTML tag 'a' requires an end tag}}
39 // expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}
43 // expected-warning@+2 {{HTML tag 'a' requires an end tag}}
44 // expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}
48 // expected-warning@+2 {{HTML start tag prematurely ended, expected attribute name or '>'}} expected-note@+1 {{HTML tag started here}}
49 /** Aaa bbb<img ddd eee
54 // expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}
55 /** Aaa bbb<img ddd eee 42%
60 // expected-warning@+1 {{HTML end tag 'br' is forbidden}}
64 /// <blockquote>Meow</blockquote>
65 int test_html_nesting1(int);
67 /// <b><i>Meow</i></b>
68 int test_html_nesting2(int);
72 int test_html_nesting3(int);
76 int test_html_nesting4(int);
78 // expected-warning@+3 {{HTML tag 'b' requires an end tag}}
79 // expected-warning@+2 {{HTML tag 'i' requires an end tag}}
80 // expected-warning@+1 {{HTML end tag does not match any start tag}}
82 int test_html_nesting5(int);
84 // expected-warning@+2 {{HTML start tag 'i' closed by 'b'}}
85 // expected-warning@+1 {{HTML end tag does not match any start tag}}
86 /// <b><i>Meow</b></b>
87 int test_html_nesting6(int);
89 // expected-warning@+2 {{HTML start tag 'i' closed by 'b'}}
90 // expected-warning@+1 {{HTML end tag does not match any start tag}}
91 /// <b><i>Meow</b></i>
92 int test_html_nesting7(int);
94 // expected-warning@+1 {{HTML tag 'b' requires an end tag}}
96 int test_html_nesting8(int);
98 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
99 /// \brief\returns Aaa
100 int test_block_command1(int);
102 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
103 /// \brief \returns Aaa
104 int test_block_command2(int);
106 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
109 int test_block_command3(int);
111 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
115 int test_block_command4(int);
117 // There is trailing whitespace on one of the following lines, don't remove it!
118 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
122 int test_block_command5(int);
125 int test_block_command6(int);
127 // expected-warning@+5 {{duplicated command '\brief'}} expected-note@+1 {{previous command '\brief' here}}
133 int test_duplicate_brief1(int);
135 // expected-warning@+5 {{duplicated command '\short'}} expected-note@+1 {{previous command '\short' here}}
141 int test_duplicate_brief2(int);
143 // expected-warning@+5 {{duplicated command '\brief'}} expected-note@+1 {{previous command '\short' (an alias of '\brief') here}}
149 int test_duplicate_brief3(int);
157 int test_multiple_returns1(int);
164 int test_multiple_returns2(int);
171 int test_multiple_returns3(int);
178 int test_multiple_returns4(int);
181 // expected-warning@+1 {{'\param' command used in a comment that is not attached to a function declaration}}
182 /// \param a Blah blah.
183 int test_param1_backslash;
186 // Check that the diagnostic uses the same command marker as the comment.
187 // expected-warning@+1 {{'@param' command used in a comment that is not attached to a function declaration}}
188 /// @param a Blah blah.
191 // expected-warning@+1 {{empty paragraph passed to '\param' command}}
193 /// \param a Blah blah.
194 int test_param2(int a);
196 // expected-warning@+1 {{empty paragraph passed to '\param' command}}
198 int test_param3(int a);
200 /// \param a Blah blah.
201 int test_param4(int a);
203 /// \param [in] a Blah blah.
204 int test_param5(int a);
206 /// \param [out] a Blah blah.
207 int test_param6(int a);
209 /// \param [in,out] a Blah blah.
210 int test_param7(int a);
212 // expected-warning@+1 {{whitespace is not allowed in parameter passing direction}}
213 /// \param [ in ] a Blah blah.
214 int test_param8(int a);
216 // expected-warning@+1 {{whitespace is not allowed in parameter passing direction}}
217 /// \param [in, out] a Blah blah.
218 int test_param9(int a);
220 // expected-warning@+1 {{unrecognized parameter passing direction, valid directions are '[in]', '[out]' and '[in,out]'}}
221 /// \param [ junk] a Blah blah.
222 int test_param10(int a);
224 // expected-warning@+1 {{parameter 'a' not found in the function declaration}}
225 /// \param a Blah blah.
228 // expected-warning@+1 {{parameter 'A' not found in the function declaration}} expected-note@+1 {{did you mean 'a'?}}
229 /// \param A Blah blah.
230 int test_param12(int a);
232 // expected-warning@+1 {{parameter 'aab' not found in the function declaration}} expected-note@+1 {{did you mean 'aaa'?}}
233 /// \param aab Blah blah.
234 int test_param13(int aaa, int bbb);
236 // expected-warning@+2 {{parameter 'aab' not found in the function declaration}} expected-note@+2 {{did you mean 'bbb'?}}
237 /// \param aaa Blah blah.
238 /// \param aab Blah blah.
239 int test_param14(int aaa, int bbb);
241 // expected-warning@+1 {{parameter 'aab' not found in the function declaration}}
242 /// \param aab Blah blah.
243 int test_param15(int bbb, int ccc);
245 // expected-warning@+1 {{parameter 'aab' not found in the function declaration}}
249 int test_param16(int aaa, int bbb);
251 // expected-warning@+2 {{parameter 'aab' not found in the function declaration}}
255 int test_param17(int aaa, int bbb);
257 // expected-warning@+3 {{parameter 'aab' not found in the function declaration}}
261 int test_param18(int aaa, int bbb);
264 // expected-warning@+1 {{parameter 'aaa' not found in the function declaration}}
265 /// \param aaa Blah blah.
268 // expected-warning@+1 {{parameter 'aaa' not found in the function declaration}}
269 /// \param aaa Blah blah.
270 int test_param19(int bbb, int ccc);
273 // expected-warning@+1 {{parameter 'aab' not found in the function declaration}}
274 /// \param aab Blah blah.
276 void test_param20(int bbb, int ccc);
278 // expected-warning@+3 {{parameter 'a' is already documented}}
279 // expected-note@+1 {{previous documentation}}
282 int test_param21(int a);
284 // expected-warning@+4 {{parameter 'x2' is already documented}}
285 // expected-note@+2 {{previous documentation}}
289 int test_param22(int x1, int x2, int x3);
292 // Test that we treat typedefs to some non-function types as functions for the
293 // purposes of documentation comment parsing.
297 inline namespace bar {
299 struct function_wrapper {};
302 struct not_a_function_wrapper {};
306 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
310 typedef int test_function_like_typedef1(int aaa, int ccc);
312 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
316 typedef int (*test_function_like_typedef2)(int aaa, int ccc);
318 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
322 typedef int (* const test_function_like_typedef3)(int aaa, int ccc);
324 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
328 typedef int (C::*test_function_like_typedef4)(int aaa, int ccc);
330 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
334 typedef foo::function_wrapper<int (int aaa, int ccc)> test_function_like_typedef5;
336 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
340 typedef foo::function_wrapper<int (int aaa, int ccc)> *test_function_like_typedef6;
342 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
346 typedef foo::function_wrapper<int (int aaa, int ccc)> &test_function_like_typedef7;
348 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
352 typedef foo::function_wrapper<int (int aaa, int ccc)> &&test_function_like_typedef8;
355 typedef int (*test_not_function_like_typedef1)(int aaa);
357 // expected-warning@+1 {{'\param' command used in a comment that is not attached to a function declaration}}
359 typedef test_not_function_like_typedef1 test_not_function_like_typedef2;
362 // Check that the diagnostic uses the same command marker as the comment.
363 // expected-warning@+1 {{'@param' command used in a comment that is not attached to a function declaration}}
365 typedef unsigned int test_not_function_like_typedef3;
367 // expected-warning@+1 {{'\param' command used in a comment that is not attached to a function declaration}}
369 typedef foo::not_a_function_wrapper<1> test_not_function_like_typedef4;
372 /// \param ... Vararg
373 int test_vararg_param1(int aaa, ...);
375 /// \param ... Vararg
376 int test_vararg_param2(...);
378 // expected-warning@+1 {{parameter '...' not found in the function declaration}} expected-note@+1 {{did you mean 'aaa'?}}
379 /// \param ... Vararg
380 int test_vararg_param3(int aaa);
382 // expected-warning@+1 {{parameter '...' not found in the function declaration}}
383 /// \param ... Vararg
384 int test_vararg_param4();
388 /// \param ... Vararg
390 int test_template_vararg_param1(int aaa, ...);
392 /// \param ... Vararg
394 int test_template_vararg_param2(...);
396 // expected-warning@+1 {{parameter '...' not found in the function declaration}} expected-note@+1 {{did you mean 'aaa'?}}
397 /// \param ... Vararg
399 int test_template_vararg_param3(int aaa);
401 // expected-warning@+1 {{parameter '...' not found in the function declaration}}
402 /// \param ... Vararg
404 int test_template_vararg_param4();
407 // expected-warning@+1 {{'\tparam' command used in a comment that is not attached to a template declaration}}
411 // expected-warning@+1 {{'\tparam' command used in a comment that is not attached to a template declaration}}
413 void test_tparam2(int aaa);
415 // expected-warning@+1 {{empty paragraph passed to '\tparam' command}}
417 /// \param aaa Blah blah
419 void test_tparam3(T aaa);
421 // expected-warning@+1 {{template parameter 'T' not found in the template declaration}} expected-note@+1 {{did you mean 'TT'?}}
423 template<typename TT>
424 void test_tparam4(TT aaa);
426 // expected-warning@+1 {{template parameter 'T' not found in the template declaration}} expected-note@+1 {{did you mean 'TT'?}}
428 template<typename TT>
430 // expected-warning@+1 {{template parameter 'T' not found in the template declaration}} expected-note@+1 {{did you mean 'TTT'?}}
432 template<typename TTT>
433 void test_tparam6(TTT aaa);
438 template<typename T1, typename T2>
439 void test_tparam7(T1 aaa, T2 bbb);
441 // expected-warning@+1 {{template parameter 'SomTy' not found in the template declaration}} expected-note@+1 {{did you mean 'SomeTy'?}}
442 /// \tparam SomTy Aaa
443 /// \tparam OtherTy Bbb
444 template<typename SomeTy, typename OtherTy>
445 void test_tparam8(SomeTy aaa, OtherTy bbb);
447 // expected-warning@+2 {{template parameter 'T1' is already documented}} expected-note@+1 {{previous documentation}}
450 template<typename T1, typename T2>
451 void test_tparam9(T1 aaa, T2 bbb);
455 template<template<typename T> class TT>
456 void test_tparam10(TT<int> aaa);
461 template<template<template<typename T> class TT, class C> class TTT>
462 void test_tparam11();
466 void test_tparam12();
468 template<typename T, typename U>
469 class test_tparam13 { };
473 using test_tparam14 = test_tparam13<T, int>;
475 // expected-warning@+1 {{template parameter 'U' not found in the template declaration}} expected-note@+1 {{did you mean 'T'?}}
478 using test_tparam15 = test_tparam13<T, int>;
484 class test_tparam16 { };
486 typedef test_tparam16<int> test_tparam17;
487 typedef test_tparam16<double> test_tparam18;
494 typedef test_tparam19<int> test_tparam20;
495 typedef test_tparam19<double> test_tparam21;
499 class test_tparam19 { };
503 // expected-warning@+1 {{'@tparam' command used in a comment that is not attached to a template declaration}}
512 void test_deprecated_1(int a) __attribute__((deprecated));
514 // We don't want \deprecated to warn about empty paragraph. It is fine to use
515 // \deprecated by itself without explanations.
519 void test_deprecated_2(int a) __attribute__((deprecated));
523 void test_deprecated_3(int a) __attribute__((availability(macosx,introduced=10.4)));
527 void test_deprecated_4(int a) __attribute__((unavailable));
529 // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}} expected-note@+3 {{add a deprecation attribute to the declaration to silence this warning}}
532 void test_deprecated_5(int a);
534 // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}} expected-note@+3 {{add a deprecation attribute to the declaration to silence this warning}}
537 void test_deprecated_6(int a) {
540 // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}
544 void test_deprecated_7(T aaa);
548 // expected-note@+2 {{previous command '\headerfile' here}}
549 // expected-warning@+2 {{duplicated command '\headerfile'}}
551 /// \headerfile foo.h
552 int test__headerfile_1(int a);
556 void test_invariant_1(int a);
558 // expected-warning@+1 {{empty paragraph passed to '\invariant' command}}
560 void test_invariant_2(int a);
565 int test_returns_right_decl_1(int);
567 class test_returns_right_decl_2 {
570 int test_returns_right_decl_3(int);
576 int test_returns_right_decl_4(T aaa);
581 int test_returns_right_decl_4(int aaa);
585 T test_returns_right_decl_5(T aaa);
587 // expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}}
589 int test_returns_wrong_decl_1_backslash;
592 // Check that the diagnostic uses the same command marker as the comment.
593 // expected-warning@+1 {{'@returns' command used in a comment that is not attached to a function or method declaration}}
595 int test_returns_wrong_decl_1_at;
597 // expected-warning@+1 {{'\return' command used in a comment that is not attached to a function or method declaration}}
599 int test_returns_wrong_decl_2;
601 // expected-warning@+1 {{'\result' command used in a comment that is not attached to a function or method declaration}}
603 int test_returns_wrong_decl_3;
605 // expected-warning@+1 {{'\returns' command used in a comment that is attached to a function returning void}}
607 void test_returns_wrong_decl_4(int);
609 // expected-warning@+1 {{'\returns' command used in a comment that is attached to a function returning void}}
612 void test_returns_wrong_decl_5(T aaa);
614 // expected-warning@+1 {{'\returns' command used in a comment that is attached to a function returning void}}
617 void test_returns_wrong_decl_5(int aaa);
619 // expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}}
621 struct test_returns_wrong_decl_6 { };
623 // expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}}
625 class test_returns_wrong_decl_7 {
626 // expected-warning@+1 {{'\returns' command used in a comment that is attached to a constructor}}
628 test_returns_wrong_decl_7();
630 // expected-warning@+1 {{'\returns' command used in a comment that is attached to a destructor}}
632 ~test_returns_wrong_decl_7();
635 // expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}}
637 enum test_returns_wrong_decl_8 {
638 // expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}}
640 test_returns_wrong_decl_9
643 // expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}}
645 namespace test_returns_wrong_decl_10 { };
648 // expected-warning@+1 {{'@function' command should be used in a comment attached to a function declaration}}
649 /*! @function test_function
651 typedef unsigned int Base64Flags;
652 unsigned test_function(Base64Flags inFlags);
654 // expected-warning@+1 {{'@callback' command should be used in a comment attached to a pointer to function declaration}}
655 /*! @callback test_callback
657 typedef unsigned int BaseFlags;
658 unsigned (*test_callback)(BaseFlags inFlags);
660 // expected-warning@+1 {{'\endverbatim' command does not terminate a verbatim text block}}
662 int test_verbatim_1();
664 // expected-warning@+1 {{'\endcode' command does not terminate a verbatim text block}}
666 int test_verbatim_2();
668 // FIXME: we give a bad diagnostic here because we throw away non-documentation
671 // expected-warning@+3 {{'\endcode' command does not terminate a verbatim text block}}
675 int test_verbatim_3();
678 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
679 int test1; ///< \brief\author Aaa
681 // expected-warning@+2 {{empty paragraph passed to '\brief' command}}
682 // expected-warning@+2 {{empty paragraph passed to '\brief' command}}
683 int test2, ///< \brief\author Aaa
684 test3; ///< \brief\author Aaa
686 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
687 int test4; ///< \brief
691 class TestRelates {};
693 /// \relates TestRelates
695 void test_relates_1();
697 /// \related TestRelates
699 void test_relates_2();
701 /// \relatesalso TestRelates
703 void test_relates_3();
705 /// \relatedalso TestRelates
707 void test_relates_4();
710 // Check that we attach the comment to the declaration during parsing in the
711 // following cases. The test is based on the fact that we don't parse
712 // documentation comments that are not attached to anything.
714 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
715 /// \brief\author Aaa
718 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
719 /// \brief\author Aaa
720 int test_attach2(int);
722 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
723 /// \brief\author Aaa
724 struct test_attach3 {
725 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
726 /// \brief\author Aaa
729 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
730 int test_attach5; ///< \brief\author Aaa
732 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
733 /// \brief\author Aaa
734 int test_attach6(int);
737 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
738 /// \brief\author Aaa
740 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
741 /// \brief\author Aaa
744 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
745 int test_attach9; ///< \brief\author Aaa
747 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
748 /// \brief\author Aaa
749 int test_attach10(int);
752 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
753 /// \brief\author Aaa
755 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
756 /// \brief\author Aaa
759 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
760 test_attach11 ///< \brief\author Aaa
763 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
764 /// \brief\author Aaa
765 struct test_noattach12 *test_attach13;
767 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
768 /// \brief\author Aaa
769 typedef struct test_noattach14 *test_attach15;
771 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
772 /// \brief\author Aaa
773 typedef struct test_attach16 { int a; } test_attach17;
777 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
778 /// \brief\author Aaa
779 struct S *test_attach18;
781 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
782 /// \brief\author Aaa
783 typedef struct S *test_attach19;
785 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
786 /// \brief\author Aaa
787 struct test_attach20;
789 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
790 /// \brief\author Aaa
791 typedef struct test_attach21 {
792 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
793 /// \brief\author Aaa
797 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
798 /// \brief\author Aaa
799 namespace test_attach24 {
800 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
801 /// \brief\author Aaa
802 namespace test_attach25 {
806 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
807 /// \brief\author Aaa
810 void test_attach26(T aaa);
812 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
813 /// \brief\author Aaa
815 template<typename T, typename U>
816 void test_attach27(T aaa, U bbb);
818 // expected-warning@+2 {{empty paragraph passed to '\brief' command}}
819 // expected-warning@+2 {{template parameter 'T' not found in the template declaration}}
820 /// \brief\author Aaa
823 void test_attach27(int aaa, int bbb);
825 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
826 /// \brief\author Aaa
829 class test_attach28 {
833 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
834 /// \brief\author Aaa
835 using test_attach29 = test_attach28<int>;
837 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
838 /// \brief\author Aaa
840 template<typename T, typename U>
841 class test_attach30 { };
843 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
844 /// \brief\author Aaa
847 class test_attach30<T, int> { };
849 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
850 /// \brief\author Aaa
852 class test_attach30<int, int> { };
854 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
855 /// \brief\author Aaa
857 using test_attach31 = test_attach30<T, int>;
859 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
860 /// \brief\author Aaa
862 template<typename T, typename U, typename V>
863 class test_attach32 { };
865 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
866 /// \brief\author Aaa
868 template<typename T, typename U>
869 class test_attach32<T, U, int> { };
871 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
872 /// \brief\author Aaa
875 class test_attach32<T, int, int> { };
877 // expected-warning@+2 {{empty paragraph passed to '\brief' command}}
878 // expected-warning@+2 {{template parameter 'T' not found in the template declaration}}
879 /// \brief\author Aaa
882 class test_attach32<int, int, int> { };
884 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
885 /// \brief\author Aaa
886 class test_attach33 {
887 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
888 /// \brief\author Aaa
890 template<typename T, typename U>
891 void test_attach34(T aaa, U bbb);
895 class test_attach35 {
896 // expected-warning@+2 {{empty paragraph passed to '\brief' command}}
897 // expected-warning@+2 {{template parameter 'T' not found in the template declaration}}
898 /// \brief\author Aaa
900 template<typename TT, typename UU>
901 void test_attach36(TT aaa, UU bbb);
904 // expected-warning@+2 {{empty paragraph passed to '\brief' command}}
905 // expected-warning@+2 {{template parameter 'T' not found in the template declaration}}
906 /// \brief\author Aaa
908 template<> template<>
909 void test_attach35<int>::test_attach36(int aaa, int bbb) {}
912 class test_attach37 {
913 // expected-warning@+2 {{empty paragraph passed to '\brief' command}}
914 // expected-warning@+2 {{'\tparam' command used in a comment that is not attached to a template declaration}}
915 /// \brief\author Aaa
917 void test_attach38(int aaa, int bbb);
919 void test_attach39(int aaa, int bbb);
922 // expected-warning@+2 {{empty paragraph passed to '\brief' command}}
923 // expected-warning@+2 {{template parameter 'T' not found in the template declaration}}
924 /// \brief\author Aaa
927 void test_attach37<int>::test_attach38(int aaa, int bbb) {}
929 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
930 /// \brief\author Aaa
933 void test_attach37<T>::test_attach39(int aaa, int bbb) {}
935 // We used to emit warning that parameter 'a' is not found because we parsed
936 // the comment in context of the redeclaration which does not have parameter
938 template <typename T>
939 struct test_attach38 {
942 \param b Second param
944 template <typename B>
945 void test_attach39(T a, B b);
949 template <typename B>
950 void test_attach38<int>::test_attach39(int, B);
953 // PR13411, reduced. We used to crash on this.
957 void test_nocrash1(int);
959 // We used to crash on this.
960 // expected-warning@+2 {{empty paragraph passed to '\param' command}}
961 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
963 void test_nocrash2(int);
965 // PR13593, example 1 and 2
971 void test_nocrash3();
974 template <typename, typename>
975 void test_nocrash4() { }
982 // PR13593, example 3
987 template <typename T>
988 inline T test_nocrash5(T a1)
996 inline void test_nocrash6()
1001 // We used to crash on this.
1006 typedef const struct test_nocrash7 * test_nocrash8;
1008 // We used to crash on this.
1010 // expected-warning@+1 {{unknown command tag name}}
1011 /// aaa \unknown aaa \unknown aaa
1014 // We used to crash on this. PR15068
1016 // expected-warning@+2 {{empty paragraph passed to '@param' command}}
1017 // expected-warning@+2 {{empty paragraph passed to '@param' command}}
1020 int test_nocrash10(int x, int y);
1022 // expected-warning@+2 {{empty paragraph passed to '@param' command}} expected-warning@+2 {{parameter 'x' not found in the function declaration}}
1023 // expected-warning@+2 {{empty paragraph passed to '@param' command}} expected-warning@+2 {{parameter 'y' not found in the function declaration}}
1026 int test_nocrash11();
1028 // expected-warning@+3 {{empty paragraph passed to '@param' command}} expected-warning@+3 {{parameter 'x' not found in the function declaration}}
1029 // expected-warning@+3 {{empty paragraph passed to '@param' command}} expected-warning@+3 {{parameter 'y' not found in the function declaration}}
1034 int test_nocrash12();
1036 // expected-warning@+2 {{empty paragraph passed to '@param' command}}
1037 // expected-warning@+1 {{empty paragraph passed to '@param' command}}
1039 int test_nocrash13(int x, int y);
1045 int test_nocrash14();
1048 // expected-warning@+2 {{'@union' command should not be used in a comment attached to a non-union declaration}}
1050 @union U This is new
1052 struct U { int iS; };
1059 // expected-warning@+2 {{'@struct' command should not be used in a comment attached to a non-struct declaration}}
1076 //----------------------------------------------------------------------
1077 /// @class Predicate Predicate.h "lldb/Host/Predicate.h"
1078 /// @brief A C++ wrapper class for providing threaded access to a value
1081 /// A templatized class.
1082 /// specified values.
1083 //----------------------------------------------------------------------
1084 template <class T, class T1>
1089 //----------------------------------------------------------------------
1090 /// @class Predicate<int, char> Predicate.h "lldb/Host/Predicate.h"
1091 /// @brief A C++ wrapper class for providing threaded access to a value
1094 /// A template specilization class.
1095 //----------------------------------------------------------------------
1096 template<> class Predicate<int, char>
1100 //----------------------------------------------------------------------
1101 /// @class Predicate<T, int> Predicate.h "lldb/Host/Predicate.h"
1102 /// @brief A C++ wrapper class for providing threaded access to a value
1105 /// A partial specialization template class.
1106 //----------------------------------------------------------------------
1107 template<class T> class Predicate<T, int>
1111 /*! @function test_function
1113 template <class T> T test_function (T arg);
1115 /*! @function test_function<int>
1117 template <> int test_function<int> (int arg);