From: Dmitri Gribenko Date: Thu, 2 Aug 2012 21:36:57 +0000 (+0000) Subject: Comments: handle template paramter documentation in alias-declaration X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=967e5d7ebb775a93f9c200d19d557d18bf945f10;p=clang Comments: handle template paramter documentation in alias-declaration templates. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161215 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/Comment.cpp b/lib/AST/Comment.cpp index 15b80c6455..ecf6d2a553 100644 --- a/lib/AST/Comment.cpp +++ b/lib/AST/Comment.cpp @@ -194,6 +194,10 @@ void DeclInfo::fill() { } else if (isa(ThisDecl)) { IsTemplateDecl = true; IsTemplateSpecialization = true; + } else if (const TypeAliasTemplateDecl *TAT = + dyn_cast(ThisDecl)) { + IsTemplateDecl = true; + TemplateParameters = TAT->getTemplateParameters(); } IsFilled = true; } diff --git a/test/Sema/warn-documentation.cpp b/test/Sema/warn-documentation.cpp index b31e480db8..44d24440f0 100644 --- a/test/Sema/warn-documentation.cpp +++ b/test/Sema/warn-documentation.cpp @@ -250,6 +250,18 @@ void test_tparam11(); template void test_tparam12(); +template +class test_tparam13 { }; + +/// \tparam T Aaa +template +using test_tparam14 = test_tparam13; + +// expected-warning@+1 {{template parameter 'U' not found in the template declaration}} expected-note@+1 {{did you mean 'T'?}} +/// \tparam U Aaa +template +using test_tparam15 = test_tparam13; + // expected-warning@+1 {{empty paragraph passed to '\brief' command}} int test1; ///< \brief\brief Aaa