]> granicus.if.org Git - clang/commitdiff
Comments: handle template paramter documentation in alias-declaration
authorDmitri Gribenko <gribozavr@gmail.com>
Thu, 2 Aug 2012 21:36:57 +0000 (21:36 +0000)
committerDmitri Gribenko <gribozavr@gmail.com>
Thu, 2 Aug 2012 21:36:57 +0000 (21:36 +0000)
templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161215 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/Comment.cpp
test/Sema/warn-documentation.cpp

index 15b80c64554098d8b7550e73f5d8419abbacacbe..ecf6d2a553207fa5a8a007f4b7c96eab3d2fcf8f 100644 (file)
@@ -194,6 +194,10 @@ void DeclInfo::fill() {
   } else if (isa<ClassTemplateSpecializationDecl>(ThisDecl)) {
     IsTemplateDecl = true;
     IsTemplateSpecialization = true;
+  } else if (const TypeAliasTemplateDecl *TAT =
+                 dyn_cast<TypeAliasTemplateDecl>(ThisDecl)) {
+    IsTemplateDecl = true;
+    TemplateParameters = TAT->getTemplateParameters();
   }
   IsFilled = true;
 }
index b31e480db8c650873a75b3005b02a88d02ff01ef..44d24440f0d1bd6fef88776de3fa575237513ff4 100644 (file)
@@ -250,6 +250,18 @@ void test_tparam11();
 template<int I>
 void test_tparam12();
 
+template<typename T, typename U>
+class test_tparam13 { };
+
+/// \tparam T Aaa
+template<typename T>
+using test_tparam14 = test_tparam13<T, int>;
+
+// expected-warning@+1 {{template parameter 'U' not found in the template declaration}} expected-note@+1 {{did you mean 'T'?}}
+/// \tparam U Aaa
+template<typename T>
+using test_tparam15 = test_tparam13<T, int>;
+
 
 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
 int test1; ///< \brief\brief Aaa