brintos

brintos / llvm-project-archived public Read only

0
0
Text · 45.5 KiB · 0d1faa1 Raw
1539 lines · cpp
1// RUN: %clang_cc1 -std=c++11 -fsyntax-only -Wdocumentation -Wdocumentation-pedantic -verify %s2// RUN: %clang_cc1 -std=c++14 -fsyntax-only -Wdocumentation -Wdocumentation-pedantic -verify %s3 4// This file contains lots of corner cases, so ensure that XML we generate is not invalid.5// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng %s | FileCheck %s -check-prefix=WRONG6// WRONG-NOT: CommentXMLInvalid7 8// expected-warning@+2 {{HTML tag 'a' requires an end tag}}9// expected-warning@+1 {{expected quoted string after equals sign}}10/// <a href=>11int test_html1(int);12 13// expected-warning@+2 {{HTML tag 'a' requires an end tag}}14// expected-warning@+1 {{expected quoted string after equals sign}}15/// <a href==>16int test_html2(int);17 18// expected-warning@+3 {{HTML tag 'a' requires an end tag}}19// expected-warning@+2 {{expected quoted string after equals sign}}20// expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}21/// <a href= blah22int test_html3(int);23 24// expected-warning@+2 {{HTML tag 'a' requires an end tag}}25// expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}26/// <a =>27int test_html4(int);28 29// expected-warning@+2 {{HTML tag 'a' requires an end tag}}30// expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}31/// <a "aaa">32int test_html5(int);33 34// expected-warning@+2 {{HTML tag 'a' requires an end tag}}35// expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}36/// <a a="b" =>37int test_html6(int);38 39// expected-warning@+2 {{HTML tag 'a' requires an end tag}}40// expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}41/// <a a="b" "aaa">42int test_html7(int);43 44// expected-warning@+2 {{HTML tag 'a' requires an end tag}}45// expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}46/// <a a="b" =47int test_html8(int);48 49// expected-warning@+2 {{HTML start tag prematurely ended, expected attribute name or '>'}} expected-note@+1 {{HTML tag started here}}50/** Aaa bbb<img ddd eee51 * fff ggg.52 */53int test_html9(int);54 55// expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}56/** Aaa bbb<img ddd eee 42%57 * fff ggg.58 */59int test_html10(int);60 61// expected-warning@+1 {{HTML end tag 'br' is forbidden}}62/// <br></br>63int test_html11(int);64 65/// Aaa bbb<img/>66int test_html12(int);67 68/// Aaa bbb<img />69int test_html13(int);70 71/// Aaa bbb<img src="">72int test_html14(int);73 74/// Aaa bbb<img src=""/>75int test_html15(int);76 77/// Aaa bbb<img src="" />78int test_html16(int);79 80/// <blockquote>Meow</blockquote>81int test_html_nesting1(int);82 83/// <b><i>Meow</i></b>84int test_html_nesting2(int);85 86/// <p>Aaa<br>87/// Bbb</p>88int test_html_nesting3(int);89 90/// <p>Aaa<br />91/// Bbb</p>92int test_html_nesting4(int);93 94// expected-warning@+3 {{HTML tag 'b' requires an end tag}}95// expected-warning@+2 {{HTML tag 'i' requires an end tag}}96// expected-warning@+1 {{HTML end tag does not match any start tag}}97/// <b><i>Meow</a>98int test_html_nesting5(int);99 100// expected-warning@+2 {{HTML start tag 'i' closed by 'b'}}101// expected-warning@+1 {{HTML end tag does not match any start tag}}102/// <b><i>Meow</b></b>103int test_html_nesting6(int);104 105// expected-warning@+2 {{HTML start tag 'i' closed by 'b'}}106// expected-warning@+1 {{HTML end tag does not match any start tag}}107/// <b><i>Meow</b></i>108int test_html_nesting7(int);109 110// expected-warning@+1 {{HTML tag 'b' requires an end tag}}111/// <b>Meow112int test_html_nesting8(int);113 114// expected-warning@+1 {{empty paragraph passed to '\brief' command}}115/// \brief\returns Aaa116int test_block_command1(int);117 118// expected-warning@+1 {{empty paragraph passed to '\brief' command}}119/// \brief \returns Aaa120int test_block_command2(int);121 122// expected-warning@+1 {{empty paragraph passed to '\brief' command}}123/// \brief124/// \returns Aaa125int test_block_command3(int);126 127// expected-warning@+1 {{empty paragraph passed to '\brief' command}}128/// \brief129///130/// \returns Aaa131int test_block_command4(int);132 133// There is trailing whitespace on one of the following lines, don't remove it!134// expected-warning@+1 {{empty paragraph passed to '\brief' command}}135/// \brief136/// 137/// \returns Aaa138int test_block_command5(int);139 140/// \brief \c Aaa141int test_block_command6(int);142 143// We don't recognize comments in double quotes.144/// "\brief \returns Aaa"145int test_block_command7(int);146 147// But only if they're single-line. (Doxygen treats multi-line quotes inconsistently.)148// expected-warning@+1 {{empty paragraph passed to '\brief' command}}149/// "\brief150/// \returns Aaa"151int test_block_command8(int);152 153// expected-warning@+5 {{duplicated command '\brief'}} expected-note@+1 {{previous command '\brief' here}}154/// \brief Aaa155///156/// Bbb157///158/// \brief Ccc159int test_duplicate_brief1(int);160 161// expected-warning@+5 {{duplicated command '\short'}} expected-note@+1 {{previous command '\short' here}}162/// \short Aaa163///164/// Bbb165///166/// \short Ccc167int test_duplicate_brief2(int);168 169// expected-warning@+5 {{duplicated command '\brief'}} expected-note@+1 {{previous command '\short' (an alias of '\brief') here}}170/// \short Aaa171///172/// Bbb173///174/// \brief Ccc175int test_duplicate_brief3(int);176 177 178/// \return Aaa179///180/// Bbb181///182/// \return Ccc183int test_multiple_returns1(int);184 185/// \returns Aaa186///187/// Bbb188///189/// \returns Ccc190int test_multiple_returns2(int);191 192/// \result Aaa193///194/// Bbb195///196/// \result Ccc197int test_multiple_returns3(int);198 199/// \returns Aaa200///201/// Bbb202///203/// \return Ccc204int test_multiple_returns4(int);205 206 207/// expected-warning@+1 {{empty paragraph passed to '\retval' command}}208/// \retval 0209int test_retval_no_paragraph();210 211/// \retval 0 Everything is fine.212int test_retval_fine();213 214 215// expected-warning@+1 {{'\param' command used in a comment that is not attached to a function declaration}}216/// \param a Blah blah.217int test_param1_backslash;218 219// Check that the diagnostic uses the same command marker as the comment.220// expected-warning@+1 {{'@param' command used in a comment that is not attached to a function declaration}}221/// @param a Blah blah.222int test_param1_at;223 224// expected-warning@+1 {{empty paragraph passed to '\param' command}}225/// \param226/// \param a Blah blah.227int test_param2(int a);228 229// expected-warning@+1 {{empty paragraph passed to '\param' command}}230/// \param a231int test_param3(int a);232 233/// \param a Blah blah.234int test_param4(int a);235 236/// \param [in] a Blah blah.237int test_param5(int a);238 239/// \param [out] a Blah blah.240int test_param6(int a);241 242/// \param [in,out] a Blah blah.243int test_param7(int a);244 245// expected-warning@+1 {{whitespace is not allowed in parameter passing direction}}246/// \param [ in ] a Blah blah.247int test_param8(int a);248 249// expected-warning@+1 {{whitespace is not allowed in parameter passing direction}}250/// \param [in, out] a Blah blah.251int test_param9(int a);252 253// expected-warning@+1 {{unrecognized parameter passing direction, valid directions are '[in]', '[out]' and '[in,out]'}}254/// \param [ junk] a Blah blah.255int test_param10(int a);256 257// expected-warning@+1 {{parameter 'a' not found in the function declaration}}258/// \param a Blah blah.259int test_param11();260 261// expected-warning@+1 {{parameter 'A' not found in the function declaration}} expected-note@+1 {{did you mean 'a'?}}262/// \param A Blah blah.263int test_param12(int a);264 265// expected-warning@+1 {{parameter 'aab' not found in the function declaration}} expected-note@+1 {{did you mean 'aaa'?}}266/// \param aab Blah blah.267int test_param13(int aaa, int bbb);268 269// expected-warning@+2 {{parameter 'aab' not found in the function declaration}} expected-note@+2 {{did you mean 'bbb'?}}270/// \param aaa Blah blah.271/// \param aab Blah blah.272int test_param14(int aaa, int bbb);273 274// expected-warning@+1 {{parameter 'aab' not found in the function declaration}}275/// \param aab Blah blah.276int test_param15(int bbb, int ccc);277 278// expected-warning@+1 {{parameter 'aab' not found in the function declaration}}279/// \param aab Ccc.280/// \param aaa Aaa.281/// \param bbb Bbb.282int test_param16(int aaa, int bbb);283 284// expected-warning@+2 {{parameter 'aab' not found in the function declaration}}285/// \param aaa Aaa.286/// \param aab Ccc.287/// \param bbb Bbb.288int test_param17(int aaa, int bbb);289 290// expected-warning@+3 {{parameter 'aab' not found in the function declaration}}291/// \param aaa Aaa.292/// \param bbb Bbb.293/// \param aab Ccc.294int test_param18(int aaa, int bbb);295 296class C {297  // expected-warning@+1 {{parameter 'aaa' not found in the function declaration}}298  /// \param aaa Blah blah.299  C(int bbb, int ccc);300 301  // expected-warning@+1 {{parameter 'aaa' not found in the function declaration}}302  /// \param aaa Blah blah.303 int test_param19(int bbb, int ccc);304};305 306// expected-warning@+1 {{parameter 'aab' not found in the function declaration}}307/// \param aab Blah blah.308template<typename T>309void test_param20(int bbb, int ccc);310 311// expected-warning@+3 {{parameter 'a' is already documented}}312// expected-note@+1 {{previous documentation}}313/// \param a Aaa.314/// \param a Aaa.315int test_param21(int a);316 317// expected-warning@+4 {{parameter 'x2' is already documented}}318// expected-note@+2 {{previous documentation}}319/// \param x1 Aaa.320/// \param x2 Bbb.321/// \param x2 Ccc.322int test_param22(int x1, int x2, int x3);323 324// expected-warning@+1 {{empty paragraph passed to '\param' command}}325/// \param a326/// \retval 0 Blah blah.327int test_param23(int a);328 329/// \param a \ref test_param23 has an empty paragraph, this doesn't.330int test_param24(int a);331 332//===---333// Test that we treat typedefs to some non-function types as functions for the334// purposes of documentation comment parsing.335//===---336 337namespace foo {338  inline namespace bar {339    template<typename>340    struct function_wrapper {};341 342    template<unsigned>343    struct not_a_function_wrapper {};344  }345};346 347// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}348/// \param aaa Meow.349/// \param bbb Bbb.350/// \returns aaa.351typedef int test_function_like_typedef1(int aaa, int ccc);352 353// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}354/// \param aaa Meow.355/// \param bbb Bbb.356/// \returns aaa.357typedef int (*test_function_like_typedef2)(int aaa, int ccc);358 359// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}360/// \param aaa Meow.361/// \param bbb Bbb.362/// \returns aaa.363typedef int (* const test_function_like_typedef3)(int aaa, int ccc);364 365// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}366/// \param aaa Meow.367/// \param bbb Bbb.368/// \returns aaa.369typedef int (C::*test_function_like_typedef4)(int aaa, int ccc);370 371// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}372/// \param aaa Meow.373/// \param bbb Bbb.374/// \returns aaa.375typedef foo::function_wrapper<int (int aaa, int ccc)> test_function_like_typedef5;376 377// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}378/// \param aaa Meow.379/// \param bbb Bbb.380/// \returns aaa.381typedef foo::function_wrapper<int (int aaa, int ccc)> *test_function_like_typedef6;382 383// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}384/// \param aaa Meow.385/// \param bbb Bbb.386/// \returns aaa.387typedef foo::function_wrapper<int (int aaa, int ccc)> &test_function_like_typedef7;388 389// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}390/// \param aaa Meow.391/// \param bbb Bbb.392/// \returns aaa.393typedef foo::function_wrapper<int (int aaa, int ccc)> &&test_function_like_typedef8;394 395 396typedef int (*test_not_function_like_typedef1)(int aaa);397 398// expected-warning@+1 {{'\param' command used in a comment that is not attached to a function declaration}}399/// \param aaa Meow.400typedef test_not_function_like_typedef1 test_not_function_like_typedef2;401 402// Check that the diagnostic uses the same command marker as the comment.403// expected-warning@+1 {{'@param' command used in a comment that is not attached to a function declaration}}404/// @param aaa Meow.405typedef unsigned int test_not_function_like_typedef3;406 407// expected-warning@+1 {{'\param' command used in a comment that is not attached to a function declaration}}408/// \param aaa Meow.409typedef foo::not_a_function_wrapper<1> test_not_function_like_typedef4;410 411// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}412/// \param aaa Meow.413/// \param bbb Bbb.414/// \returns aaa.415using test_function_like_using1 = int (int aaa, int ccc);416 417// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}418/// \param aaa Meow.419/// \param bbb Bbb.420/// \returns aaa.421using test_function_like_using2 = int (*)(int aaa, int ccc);422 423// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}424/// \param aaa Meow.425/// \param bbb Bbb.426/// \returns aaa.427using test_function_like_using3 = int (* const)(int aaa, int ccc);428 429// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}430/// \param aaa Meow.431/// \param bbb Bbb.432/// \returns aaa.433using test_function_like_using4 = int (C::*)(int aaa, int ccc);434 435// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}436/// \param aaa Meow.437/// \param bbb Bbb.438/// \returns aaa.439using test_function_like_using5 = foo::function_wrapper<int (int aaa, int ccc)>;440 441// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}442/// \param aaa Meow.443/// \param bbb Bbb.444/// \returns aaa.445using test_function_like_using6 = foo::function_wrapper<int (int aaa, int ccc)> *;446 447// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}448/// \param aaa Meow.449/// \param bbb Bbb.450/// \returns aaa.451using test_function_like_using7 = foo::function_wrapper<int (int aaa, int ccc)> &;452 453// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}454/// \param aaa Meow.455/// \param bbb Bbb.456/// \returns aaa.457using test_function_like_using8 = foo::function_wrapper<int (int aaa, int ccc)> &&;458 459// expected-warning@+4 {{template parameter 'U' not found in the template declaration}} expected-note@+4 {{did you mean 'T'?}}460// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}461/// \param aaa Meow.462/// \param bbb Bbb.463/// \tparam U Uuu.464template<typename T>465using test_function_like_using9 = int(T aaa, int ccc);466 467// expected-warning@+4 {{template parameter 'U' not found in the template declaration}} expected-note@+4 {{did you mean 'T'?}}468// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}469/// \param aaa Meow.470/// \param bbb Bbb.471/// \tparam U Uuu.472template<typename T>473using test_function_like_using10 = int (*)(T aaa, int ccc);474 475// expected-warning@+4 {{template parameter 'U' not found in the template declaration}} expected-note@+4 {{did you mean 'T'?}}476// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}477/// \param aaa Meow.478/// \param bbb Bbb.479/// \tparam U Uuu.480template<typename T>481using test_function_like_using11 = foo::function_wrapper<int (T aaa, int ccc)>;482 483// expected-warning@+4 {{template parameter 'U' not found in the template declaration}} expected-note@+4 {{did you mean 'T'?}}484// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}485/// \param aaa Meow.486/// \param bbb Bbb.487/// \tparam U Uuu.488template<typename T>489using test_function_like_using12 = foo::function_wrapper<int (T aaa, int ccc)> *;490 491using test_not_function_like_using1 = int (*)(int aaa);492 493// expected-warning@+1 {{'\param' command used in a comment that is not attached to a function declaration}}494/// \param aaa Meow.495using test_not_function_like_using2 = test_not_function_like_using1;496 497// Check that the diagnostic uses the same command marker as the comment.498// expected-warning@+1 {{'@param' command used in a comment that is not attached to a function declaration}}499/// @param aaa Meow.500using test_not_function_like_using3 = unsigned int;501 502// expected-warning@+1 {{'\param' command used in a comment that is not attached to a function declaration}}503/// \param aaa Meow.504using test_not_function_like_using4 = foo::not_a_function_wrapper<1>;505 506/// \param aaa Aaa507/// \param ... Vararg508int test_vararg_param1(int aaa, ...);509 510/// \param ... Vararg511int test_vararg_param2(...);512 513// expected-warning@+1 {{parameter '...' not found in the function declaration}} expected-note@+1 {{did you mean 'aaa'?}}514/// \param ... Vararg515int test_vararg_param3(int aaa);516 517// expected-warning@+1 {{parameter '...' not found in the function declaration}}518/// \param ... Vararg519int test_vararg_param4();520 521 522/// \param aaa Aaa523/// \param ... Vararg524template<typename T>525int test_template_vararg_param1(int aaa, ...);526 527/// \param ... Vararg528template<typename T>529int test_template_vararg_param2(...);530 531// expected-warning@+1 {{parameter '...' not found in the function declaration}} expected-note@+1 {{did you mean 'aaa'?}}532/// \param ... Vararg533template<typename T>534int test_template_vararg_param3(int aaa);535 536// expected-warning@+1 {{parameter '...' not found in the function declaration}}537/// \param ... Vararg538template<typename T>539int test_template_vararg_param4();540 541 542// expected-warning@+1 {{'\tparam' command used in a comment that is not attached to a template declaration}}543/// \tparam T Aaa544int test_tparam1;545 546// expected-warning@+1 {{'\tparam' command used in a comment that is not attached to a template declaration}}547/// \tparam T Aaa548void test_tparam2(int aaa);549 550// expected-warning@+1 {{empty paragraph passed to '\tparam' command}}551/// \tparam552/// \param aaa Blah blah553template<typename T>554void test_tparam3(T aaa);555 556// expected-warning@+1 {{template parameter 'T' not found in the template declaration}} expected-note@+1 {{did you mean 'TT'?}}557/// \tparam T Aaa558template<typename TT>559void test_tparam4(TT aaa);560 561// expected-warning@+1 {{template parameter 'T' not found in the template declaration}} expected-note@+1 {{did you mean 'TT'?}}562/// \tparam T Aaa563template<typename TT>564class test_tparam5 {565  // expected-warning@+1 {{template parameter 'T' not found in the template declaration}} expected-note@+1 {{did you mean 'TTT'?}}566  /// \tparam T Aaa567  template<typename TTT>568  void test_tparam6(TTT aaa);569};570 571/// \tparam T1 Aaa572/// \tparam T2 Bbb573template<typename T1, typename T2>574void test_tparam7(T1 aaa, T2 bbb);575 576// expected-warning@+1 {{template parameter 'SomTy' not found in the template declaration}} expected-note@+1 {{did you mean 'SomeTy'?}}577/// \tparam SomTy Aaa578/// \tparam OtherTy Bbb579template<typename SomeTy, typename OtherTy>580void test_tparam8(SomeTy aaa, OtherTy bbb);581 582// expected-warning@+2 {{template parameter 'T1' is already documented}} expected-note@+1 {{previous documentation}}583/// \tparam T1 Aaa584/// \tparam T1 Bbb585template<typename T1, typename T2>586void test_tparam9(T1 aaa, T2 bbb);587 588/// \tparam T Aaa589/// \tparam TT Bbb590template<template<typename T> class TT>591void test_tparam10(TT<int> aaa);592 593/// \tparam T Aaa594/// \tparam TT Bbb595/// \tparam TTT Ccc596template<template<template<typename T> class TT, class C> class TTT>597void test_tparam11();598 599/// \tparam I Aaa600template<int I>601void test_tparam12();602 603template<typename T, typename U>604class test_tparam13 { };605 606/// \tparam T Aaa607template<typename T>608using test_tparam14 = test_tparam13<T, int>;609 610// expected-warning@+1 {{template parameter 'U' not found in the template declaration}} expected-note@+1 {{did you mean 'T'?}}611/// \tparam U Aaa612template<typename T>613using test_tparam15 = test_tparam13<T, int>;614 615// ----616 617/// \tparam T Aaa618template<typename T>619class test_tparam16 { };620 621typedef test_tparam16<int> test_tparam17;622typedef test_tparam16<double> test_tparam18;623 624// ----625 626template<typename T>627class test_tparam19;628 629typedef test_tparam19<int> test_tparam20;630typedef test_tparam19<double> test_tparam21;631 632/// \tparam T Aaa633template<typename T>634class test_tparam19 { };635 636// ----637 638// expected-warning@+1 {{'@tparam' command used in a comment that is not attached to a template declaration}}639/// @tparam T Aaa640int test_tparam22;641 642// ----643 644 645/// Aaa646/// \deprecated Bbb647void test_deprecated_1(int a) __attribute__((deprecated));648 649#if __cplusplus >= 201402L650/// Aaa651/// \deprecated Bbb652[[deprecated]] void test_deprecated_no_warning_std14(int a);653#endif654 655// We don't want \deprecated to warn about empty paragraph.  It is fine to use656// \deprecated by itself without explanations.657 658/// Aaa659/// \deprecated660void test_deprecated_2(int a) __attribute__((deprecated));661 662/// Aaa663/// \deprecated664void test_deprecated_3(int a) __attribute__((availability(macosx,introduced=10.4)));665 666/// Aaa667/// \deprecated668void test_deprecated_4(int a) __attribute__((unavailable));669 670// 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}}671/// Aaa672/// \deprecated673void test_deprecated_5(int a);674 675// 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}}676/// Aaa677/// @deprecated678void test_deprecated_6(int a) {679}680 681// expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}682/// Aaa683/// \deprecated684template<typename T>685void test_deprecated_7(T aaa);686 687class PR43753 {688  // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}689  // expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}690  /// \deprecated691  static void test_deprecated_static();692 693  // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}694  // expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}695  /// \deprecated696  static auto test_deprecated_static_trailing_return() -> int;697 698#if __cplusplus >= 201402L699  // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}700  // expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}701  /// \deprecated702  static decltype(auto) test_deprecated_static_decltype_auto() { return 1; }703#endif704 705  // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}706  // expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}707  /// \deprecated708  void test_deprecated_const() const;709 710  // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}711  // expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}712  /// \deprecated713  auto test_deprecated_trailing_return() -> int;714 715#if __cplusplus >= 201402L716  // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}717  // expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}718  /// \deprecated719  decltype(auto) test_deprecated_decltype_auto() const { return a; }720 721private:722  int a{0};723#endif724};725 726// expected-note@+2 {{previous command '\headerfile' here}}727// expected-warning@+2 {{duplicated command '\headerfile'}}728/// \headerfile ""729/// \headerfile foo.h730int test__headerfile_1(int a);731 732 733/// \invariant aaa734void test_invariant_1(int a);735 736// expected-warning@+1 {{empty paragraph passed to '\invariant' command}}737/// \invariant738void test_invariant_2(int a);739 740 741// no-warning742/// \returns Aaa743int test_returns_right_decl_1(int);744 745class test_returns_right_decl_2 {746  // no-warning747  /// \returns Aaa748  int test_returns_right_decl_3(int);749};750 751// no-warning752/// \returns Aaa753template<typename T>754int test_returns_right_decl_4(T aaa);755 756// no-warning757/// \returns Aaa758template<>759int test_returns_right_decl_4(int aaa);760 761/// \returns Aaa762template<typename T>763T test_returns_right_decl_5(T aaa);764 765// expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}}766/// \returns Aaa767int test_returns_wrong_decl_1_backslash;768 769// Check that the diagnostic uses the same command marker as the comment.770// expected-warning@+1 {{'@returns' command used in a comment that is not attached to a function or method declaration}}771/// @returns Aaa772int test_returns_wrong_decl_1_at;773 774// expected-warning@+1 {{'\return' command used in a comment that is not attached to a function or method declaration}}775/// \return Aaa776int test_returns_wrong_decl_2;777 778// expected-warning@+1 {{'\result' command used in a comment that is not attached to a function or method declaration}}779/// \result Aaa780int test_returns_wrong_decl_3;781 782// expected-warning@+1 {{'\returns' command used in a comment that is attached to a function returning void}}783/// \returns Aaa784void test_returns_wrong_decl_4(int);785 786// expected-warning@+1 {{'\returns' command used in a comment that is attached to a function returning void}}787/// \returns Aaa788template<typename T>789void test_returns_wrong_decl_5(T aaa);790 791// expected-warning@+1 {{'\returns' command used in a comment that is attached to a function returning void}}792/// \returns Aaa793template<>794void test_returns_wrong_decl_5(int aaa);795 796// expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}}797/// \returns Aaa798struct test_returns_wrong_decl_6 { };799 800// expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}}801/// \returns Aaa802class test_returns_wrong_decl_7 {803  // expected-warning@+1 {{'\returns' command used in a comment that is attached to a constructor}}804  /// \returns Aaa805  test_returns_wrong_decl_7();806 807  // expected-warning@+1 {{'\returns' command used in a comment that is attached to a destructor}}808  /// \returns Aaa809  ~test_returns_wrong_decl_7();810};811 812// expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}}813/// \returns Aaa814enum test_returns_wrong_decl_8 {815  // expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}}816  /// \returns Aaa817  test_returns_wrong_decl_9818};819 820// expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}}821/// \returns Aaa822namespace test_returns_wrong_decl_10 { };823 824// expected-warning@+1 {{'@function' command should be used in a comment attached to a function declaration}}825/*!	@function test_function826*/827typedef unsigned int Base64Flags;828unsigned test_function(Base64Flags inFlags);829 830// expected-warning@+1 {{'@callback' command should be used in a comment attached to a pointer to function declaration}}831/*! @callback test_callback832*/833typedef unsigned int BaseFlags;834unsigned (*test_callback)(BaseFlags inFlags);835 836// expected-warning@+1 {{'\endverbatim' command does not terminate a verbatim text block}}837/// \endverbatim838int test_verbatim_1();839 840// expected-warning@+1 {{'\endcode' command does not terminate a verbatim text block}}841/// \endcode842int test_verbatim_2();843 844// FIXME: we give a bad diagnostic here because we throw away non-documentation845// comments early.846//847// expected-warning@+3 {{'\endcode' command does not terminate a verbatim text block}}848/// \code849//  foo850/// \endcode851int test_verbatim_3();852 853 854// expected-warning@+1 {{empty paragraph passed to '\brief' command}}855int test1; ///< \brief\author Aaa856 857// expected-warning@+2 {{empty paragraph passed to '\brief' command}}858// expected-warning@+2 {{empty paragraph passed to '\brief' command}}859int test2, ///< \brief\author Aaa860    test3; ///< \brief\author Aaa861 862// expected-warning@+1 {{empty paragraph passed to '\brief' command}}863int test4; ///< \brief864           ///< \author Aaa865 866 867class TestRelates {};868 869/// \relates TestRelates870/// \brief Aaa871void test_relates_1();872 873/// \related TestRelates874/// \brief Aaa875void test_relates_2();876 877/// \relatesalso TestRelates878/// \brief Aaa879void test_relates_3();880 881/// \relatedalso TestRelates882/// \brief Aaa883void test_relates_4();884 885 886// Check that we attach the comment to the declaration during parsing in the887// following cases.  The test is based on the fact that we don't parse888// documentation comments that are not attached to anything.889 890// expected-warning@+1 {{empty paragraph passed to '\brief' command}}891/// \brief\author Aaa892int test_attach1;893 894// expected-warning@+1 {{empty paragraph passed to '\brief' command}}895/// \brief\author Aaa896int test_attach2(int);897 898// expected-warning@+1 {{empty paragraph passed to '\brief' command}}899/// \brief\author Aaa900struct test_attach3 {901  // expected-warning@+1 {{empty paragraph passed to '\brief' command}}902  /// \brief\author Aaa903  int test_attach4;904 905  // expected-warning@+1 {{empty paragraph passed to '\brief' command}}906  int test_attach5; ///< \brief\author Aaa907 908  // expected-warning@+1 {{empty paragraph passed to '\brief' command}}909  /// \brief\author Aaa910  int test_attach6(int);911};912 913// expected-warning@+1 {{empty paragraph passed to '\brief' command}}914/// \brief\author Aaa915class test_attach7 {916  // expected-warning@+1 {{empty paragraph passed to '\brief' command}}917  /// \brief\author Aaa918  int test_attach8;919 920  // expected-warning@+1 {{empty paragraph passed to '\brief' command}}921  int test_attach9; ///< \brief\author Aaa922 923  // expected-warning@+1 {{empty paragraph passed to '\brief' command}}924  /// \brief\author Aaa925  int test_attach10(int);926};927 928// expected-warning@+1 {{empty paragraph passed to '\brief' command}}929/// \brief\author Aaa930enum test_attach9 {931  // expected-warning@+1 {{empty paragraph passed to '\brief' command}}932  /// \brief\author Aaa933  test_attach10,934 935  // expected-warning@+1 {{empty paragraph passed to '\brief' command}}936  test_attach11 ///< \brief\author Aaa937};938 939// expected-warning@+1 {{empty paragraph passed to '\brief' command}}940/// \brief\author Aaa941struct test_noattach12 *test_attach13;942 943// expected-warning@+1 {{empty paragraph passed to '\brief' command}}944/// \brief\author Aaa945typedef struct test_noattach14 *test_attach15;946 947// expected-warning@+1 + {{empty paragraph passed to '\brief' command}}948/// \brief\author Aaa949typedef struct test_attach16 { int a; } test_attach17;950 951struct S { int a; };952 953// expected-warning@+1 {{empty paragraph passed to '\brief' command}}954/// \brief\author Aaa955struct S *test_attach18;956 957// expected-warning@+1 {{empty paragraph passed to '\brief' command}}958/// \brief\author Aaa959typedef struct S *test_attach19;960 961// expected-warning@+1 {{empty paragraph passed to '\brief' command}}962/// \brief\author Aaa963struct test_attach20;964 965// expected-warning@+1 + {{empty paragraph passed to '\brief' command}}966/// \brief\author Aaa967typedef struct test_attach21 {968  // expected-warning@+1 {{empty paragraph passed to '\brief' command}}969  /// \brief\author Aaa970  int test_attach22;971} test_attach23;972 973// expected-warning@+1 {{empty paragraph passed to '\brief' command}}974/// \brief\author Aaa975namespace test_attach24 {976  // expected-warning@+1 {{empty paragraph passed to '\brief' command}}977  /// \brief\author Aaa978  namespace test_attach25 {979  }980}981 982// expected-warning@+1 {{empty paragraph passed to '\brief' command}}983/// \brief\author Aaa984/// \tparam T Aaa985template<typename T>986void test_attach26(T aaa);987 988// expected-warning@+1 {{empty paragraph passed to '\brief' command}}989/// \brief\author Aaa990/// \tparam T Aaa991template<typename T, typename U>992void test_attach27(T aaa, U bbb);993 994// expected-warning@+2 {{empty paragraph passed to '\brief' command}}995// expected-warning@+2 {{template parameter 'T' not found in the template declaration}}996/// \brief\author Aaa997/// \tparam T Aaa998template<>999void test_attach27(int aaa, int bbb);1000 1001// expected-warning@+1 {{empty paragraph passed to '\brief' command}}1002/// \brief\author Aaa1003/// \tparam T Aaa1004template<typename T>1005class test_attach28 {1006  T aaa;1007};1008 1009// expected-warning@+1 {{empty paragraph passed to '\brief' command}}1010/// \brief\author Aaa1011using test_attach29 = test_attach28<int>;1012 1013// expected-warning@+1 {{empty paragraph passed to '\brief' command}}1014/// \brief\author Aaa1015/// \tparam T Aaa1016template<typename T, typename U>1017class test_attach30 { };1018 1019// expected-warning@+1 {{empty paragraph passed to '\brief' command}}1020/// \brief\author Aaa1021/// \tparam T Aaa1022template<typename T>1023class test_attach30<T, int> { };1024 1025// expected-warning@+1 {{empty paragraph passed to '\brief' command}}1026/// \brief\author Aaa1027template<>1028class test_attach30<int, int> { };1029 1030// expected-warning@+1 {{empty paragraph passed to '\brief' command}}1031/// \brief\author Aaa1032template<typename T>1033using test_attach31 = test_attach30<T, int>;1034 1035// expected-warning@+1 {{empty paragraph passed to '\brief' command}}1036/// \brief\author Aaa1037/// \tparam T Aaa1038template<typename T, typename U, typename V>1039class test_attach32 { };1040 1041// expected-warning@+1 {{empty paragraph passed to '\brief' command}}1042/// \brief\author Aaa1043/// \tparam T Aaa1044template<typename T, typename U>1045class test_attach32<T, U, int> { };1046 1047// expected-warning@+1 {{empty paragraph passed to '\brief' command}}1048/// \brief\author Aaa1049/// \tparam T Aaa1050template<typename T>1051class test_attach32<T, int, int> { };1052 1053// expected-warning@+2 {{empty paragraph passed to '\brief' command}}1054// expected-warning@+2 {{template parameter 'T' not found in the template declaration}}1055/// \brief\author Aaa1056/// \tparam T Aaa1057template<>1058class test_attach32<int, int, int> { };1059 1060// expected-warning@+1 {{empty paragraph passed to '\brief' command}}1061/// \brief\author Aaa1062class test_attach33 {1063  // expected-warning@+1 {{empty paragraph passed to '\brief' command}}1064  /// \brief\author Aaa1065  /// \tparam T Aaa1066  template<typename T, typename U>1067  void test_attach34(T aaa, U bbb);1068};1069 1070template<typename T>1071class test_attach35 {1072  // expected-warning@+2 {{empty paragraph passed to '\brief' command}}1073  // expected-warning@+2 {{template parameter 'T' not found in the template declaration}}1074  /// \brief\author Aaa1075  /// \tparam T Aaa1076  template<typename TT, typename UU>1077  void test_attach36(TT aaa, UU bbb);1078};1079 1080// expected-warning@+2 {{empty paragraph passed to '\brief' command}}1081// expected-warning@+2 {{template parameter 'T' not found in the template declaration}}1082/// \brief\author Aaa1083/// \tparam T Aaa1084template<> template<>1085void test_attach35<int>::test_attach36(int aaa, int bbb) {}1086 1087template<typename T>1088class test_attach37 {1089  // expected-warning@+2 {{empty paragraph passed to '\brief' command}}1090  // expected-warning@+2 {{'\tparam' command used in a comment that is not attached to a template declaration}}1091  /// \brief\author Aaa1092  /// \tparam T Aaa1093  void test_attach38(int aaa, int bbb);1094 1095  void test_attach39(int aaa, int bbb);1096};1097 1098// expected-warning@+2 {{empty paragraph passed to '\brief' command}}1099// expected-warning@+2 {{template parameter 'T' not found in the template declaration}}1100/// \brief\author Aaa1101/// \tparam T Aaa1102template<>1103void test_attach37<int>::test_attach38(int aaa, int bbb) {}1104 1105// expected-warning@+1 {{empty paragraph passed to '\brief' command}}1106/// \brief\author Aaa1107/// \tparam T Aaa1108template<typename T>1109void test_attach37<T>::test_attach39(int aaa, int bbb) {}1110 1111// We used to emit warning that parameter 'a' is not found because we parsed1112// the comment in context of the redeclaration which does not have parameter1113// names.1114template <typename T>1115struct test_attach38 {1116  /*!1117    \param a  First param1118    \param b  Second param1119  */1120  template <typename B>1121  void test_attach39(T a, B b);1122};1123 1124template <>1125template <typename B>1126void test_attach38<int>::test_attach39(int, B);1127 1128// The inline comments expect a string after the command.1129// expected-warning@+1 {{'\a' command has no word arguments, expected 1}}1130/// \a1131int test_inline_no_argument_a_bad(int);1132 1133/// \a A1134int test_inline_no_argument_a_good(int);1135 1136// expected-warning@+1 {{'\anchor' command has no word arguments, expected 1}}1137/// \anchor1138int test_inline_no_argument_anchor_bad(int);1139 1140/// \anchor A1141int test_inline_no_argument_anchor_good(int);1142 1143// expected-warning@+1 {{'@b' command has no word arguments, expected 1}}1144/// @b1145int test_inline_no_argument_b_bad(int);1146 1147/// @b A1148int test_inline_no_argument_b_good(int);1149 1150// expected-warning@+1 {{'\c' command has no word arguments, expected 1}}1151/// \c1152int test_inline_no_argument_c_bad(int);1153 1154/// \c A1155int test_inline_no_argument_c_good(int);1156 1157// expected-warning@+1 {{'\e' command has no word arguments, expected 1}}1158/// \e1159int test_inline_no_argument_e_bad(int);1160 1161/// \e A1162int test_inline_no_argument_e_good(int);1163 1164// expected-warning@+1 {{'\em' command has no word arguments, expected 1}}1165/// \em1166int test_inline_no_argument_em_bad(int);1167 1168/// \em A1169int test_inline_no_argument_em_good(int);1170 1171// expected-warning@+1 {{'\p' command has no word arguments, expected 1}}1172/// \p1173int test_inline_no_argument_p_bad(int);1174 1175/// \p A1176int test_inline_no_argument_p_good(int);1177 1178// PR13411, reduced.  We used to crash on this.1179/**1180 * @code Aaa.1181 */1182void test_nocrash1(int);1183 1184// We used to crash on this.1185// expected-warning@+2 {{empty paragraph passed to '\param' command}}1186// expected-warning@+1 {{empty paragraph passed to '\brief' command}}1187/// \param\brief1188void test_nocrash2(int);1189 1190// PR13593, example 1 and 21191 1192/**1193* Bla.1194*/1195template <typename>1196void test_nocrash3();1197 1198/// Foo1199template <typename, typename>1200void test_nocrash4() { }1201 1202template <typename>1203void test_nocrash3()1204{1205}1206 1207// PR13593, example 31208 1209/**1210 * aaa1211 */1212template <typename T>1213inline T test_nocrash5(T a1)1214{1215    return a1;1216}1217 1218///1219//,1220 1221inline void test_nocrash6()1222{1223    test_nocrash5(1);1224}1225 1226// We used to crash on this.1227 1228/*!1229  Blah.1230*/1231typedef const struct test_nocrash7 * test_nocrash8;1232 1233// We used to crash on this.1234 1235// expected-warning@+1 {{unknown command tag name}}1236/// aaa \unknown aaa \unknown aaa1237int test_nocrash9;1238 1239// We used to crash on this.  PR150681240 1241// expected-warning@+2 {{empty paragraph passed to '@param' command}}1242// expected-warning@+2 {{empty paragraph passed to '@param' command}}1243///@param x1244///@param y1245int test_nocrash10(int x, int y);1246 1247// expected-warning@+2 {{empty paragraph passed to '@param' command}} expected-warning@+2 {{parameter 'x' not found in the function declaration}}1248// expected-warning@+2 {{empty paragraph passed to '@param' command}} expected-warning@+2 {{parameter 'y' not found in the function declaration}}1249///@param x1250///@param y1251int test_nocrash11();1252 1253// expected-warning@+3 {{empty paragraph passed to '@param' command}} expected-warning@+3 {{parameter 'x' not found in the function declaration}}1254// expected-warning@+3 {{empty paragraph passed to '@param' command}} expected-warning@+3 {{parameter 'y' not found in the function declaration}}1255/**1256@param x1257@param y1258**/1259int test_nocrash12();1260 1261// expected-warning@+2 {{empty paragraph passed to '@param' command}}1262// expected-warning@+1 {{empty paragraph passed to '@param' command}}1263///@param x@param y1264int test_nocrash13(int x, int y);1265 1266/**1267 * \verbatim1268 * Aaa1269 **/1270int test_nocrash14();1271 1272// expected-warning@+2 {{'@union' command should not be used in a comment attached to a non-union declaration}}1273/*!1274   @union U This is new 1275*/1276struct U { int iS; };1277 1278/*!1279  @union U11280*/1281union U1 {int i; };1282 1283// expected-warning@+2 {{'@struct' command should not be used in a comment attached to a non-struct declaration}}1284/*!1285 @struct S21286*/1287union S2 {};1288 1289/*!1290  @class C11291*/1292class C1;1293 1294/*!1295  @struct S3;1296*/1297class S3;1298 1299//----------------------------------------------------------------------1300/// @class Predicate Predicate.h "lldb/Host/Predicate.h"1301/// @brief A C++ wrapper class for providing threaded access to a value1302/// of type T.1303///1304/// A templatized class.1305/// specified values.1306//----------------------------------------------------------------------1307template <class T, class T1>1308class Predicate1309{1310};1311 1312//----------------------------------------------------------------------1313/// @class Predicate<int, char> Predicate.h "lldb/Host/Predicate.h"1314/// @brief A C++ wrapper class for providing threaded access to a value1315/// of type T.1316///1317/// A template specialization class.1318//----------------------------------------------------------------------1319template<> class Predicate<int, char>1320{1321};1322 1323//----------------------------------------------------------------------1324/// @class Predicate<T, int> Predicate.h "lldb/Host/Predicate.h"1325/// @brief A C++ wrapper class for providing threaded access to a value1326/// of type T.1327///1328/// A partial specialization template class.1329//----------------------------------------------------------------------1330template<class T> class Predicate<T, int>1331{1332};1333 1334/*!     @function test_function1335*/1336template <class T> T test_function (T arg);1337 1338/*!     @function test_function<int>1339*/1340template <> int test_function<int> (int arg);1341 1342namespace AllowParamAndReturnsOnFunctionPointerVars {1343 1344/**1345 * functionPointerVariable1346 *1347 * @param i is integer.1348 * @returns integer.1349 */1350int (*functionPointerVariable)(int i);1351 1352#if __cplusplus >= 201402L1353/**1354 * functionPointerVariableTemplate1355 *1356 * @param i is something.1357 * @returns integer.1358 */1359template<typename T>1360int (*functionPointerVariableTemplate)(T i);1361#endif1362 1363struct HasFields {1364  /**1365   * functionPointerField1366   *1367   * @param i is integer.1368   * @returns integer.1369   */1370  int (*functionPointerField)(int i);1371 1372#if __cplusplus >= 201402L1373  /**1374   * functionPointerTemplateMember1375   *1376   * @tparam T some type.1377   * @param i is integer.1378   * @returns integer.1379   */1380  template<typename T>1381  static int (*functionPointerTemplateMember)(int i);1382#endif1383};1384 1385// expected-warning@+5 {{parameter 'p' not found in the function declaration}}1386// expected-warning@+5 {{'\returns' command used in a comment that is attached to a function returning void}}1387/**1388 * functionPointerVariable1389 *1390 * \param p not here.1391 * \returns integer.1392 */1393void (*functionPointerVariableThatLeadsNowhere)();1394 1395#if __cplusplus >= 201402L1396// expected-warning@+8 {{template parameter 'X' not found in the template declaration}}1397// expected-note@+7 {{did you mean 'T'?}}1398// expected-warning@+7 {{parameter 'p' not found in the function declaration}}1399// expected-note@+6 {{did you mean 'x'?}}1400// expected-warning@+6 {{'\returns' command used in a comment that is attached to a function returning void}}1401/**1402 * functionPointerVariable1403 *1404 * \tparam X typo1405 * \param p not here.1406 * \returns integer.1407 */1408template<typename T>1409void (*functionPointerVariableTemplateThatLeadsNowhere)(T x);1410#endif1411 1412// Still warn about param/returns commands for variables that don't specify1413// the type directly:1414 1415/**1416 * FunctionPointerTypedef1417 *1418 * \param i is integer.1419 * \returns integer.1420 */1421typedef int (*FunctionPointerTypedef)(int i);1422 1423/**1424 * FunctionPointerTypealias1425 *1426 * \param i is integer.1427 * \returns integer.1428 */1429using FunctionPointerTypealias = int (*)(int i);1430 1431// expected-warning@+5 {{'@param' command used in a comment that is not attached to a function declaration}}1432// expected-warning@+5 {{'@returns' command used in a comment that is not attached to a function or method declaration}}1433/**1434 * functionPointerVariable1435 *1436 * @param i is integer.1437 * @returns integer.1438 */1439FunctionPointerTypedef functionPointerTypedefVariable;1440 1441struct HasMoreFields {1442  // expected-warning@+5 {{'\param' command used in a comment that is not attached to a function declaration}}1443  // expected-warning@+5 {{'\returns' command used in a comment that is not attached to a function or method declaration}}1444  /**1445   * functionPointerTypealiasField1446   *1447   * \param i is integer.1448   * \returns integer.1449   */1450  FunctionPointerTypealias functionPointerTypealiasField;1451};1452 1453}1454 1455/*!1456 * Function pointer typedef with variadic params.1457 *1458 * @param a1459 * works1460 *1461 * @param ...1462 * now should work too.1463 */1464typedef void (*VariadicFnType)(int a, ...);1465 1466/*!1467 * Function pointer type alias with variadic params.1468 *1469 * @param a1470 * works1471 *1472 * @param ...1473 * now should work too.1474 */1475using VariadicFnType2 = void (*)(int a, ...);1476 1477/*!1478 * Function pointer type variable.1479 *1480 * @param a1481 * works1482 *1483 * @param ...1484 * now should work too.1485 */1486void (*variadicFnVar)(int a, ...);1487 1488// expected-warning@+2 {{empty paragraph passed to '@note' command}}1489/**1490@note1491\f$\texttt{mu}_{00}=\texttt{m}_{00}\f$, \f$\texttt{nu}_{00}=1\f$1492\f$\texttt{nu}_{10}=\texttt{mu}_{10}=\texttt{mu}_{01}=\texttt{mu}_{10}=0\f$1493 */1494class EmptyNoteNoCrash {1495};1496 1497namespace PR42844 { // Assertion failures when using typedefed function pointers1498typedef void (*AA)();1499typedef AA A();1500A *a; ///< \return none1501// expected-warning@-1 {{'\return' command used in a comment that is not attached to a function or method declaration}}1502 1503typedef void B();1504B *b; ///< \return none1505// expected-warning@-1 {{'\return' command used in a comment that is not attached to a function or method declaration}}1506 1507void CC();1508typedef void C();1509C &c = CC; ///< \return none1510// expected-warning@-1 {{'\return' command used in a comment that is not attached to a function or method declaration}}1511 1512using DD = void(*)();1513using D = DD();1514D *d; ///< \return none1515// expected-warning@-1 {{'\return' command used in a comment that is not attached to a function or method declaration}}1516 1517using E = void();1518E *e; ///< \return none1519// expected-warning@-1 {{'\return' command used in a comment that is not attached to a function or method declaration}}1520 1521void FF();1522using F = void();1523F &f = FF; ///< \return none1524// expected-warning@-1 {{'\return' command used in a comment that is not attached to a function or method declaration}}1525 1526} // namespace PR428441527 1528#if __cplusplus >= 201402L1529namespace GH144775 {1530/// @brief primary template1531/// @tparam T type1532template <class T, class = void> constexpr auto var = T{};1533 1534/// @brief variable template partial specialization1535/// @tparam T type1536template <typename T> constexpr auto var<T> = T{};1537} // namespace GH1447751538#endif1539