Author: gribozavr
Date: Thu Aug 2 16:36:57 2012
New Revision: 161215
URL: http://llvm.org/viewvc/llvm-project?rev=161215&view=rev
Log:
Comments: handle template paramter documentation in alias-declaration
templates.
Modified:
cfe/trunk/lib/AST/Comment.cpp
cfe/trunk/test/Sema/warn-documentation.cpp
Modified: cfe/trunk/lib/AST/Comment.cpp
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Comment.cpp?rev=161215&r1=161214&r2=161215&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Comment.cpp (original)
+++ cfe/trunk/lib/AST/Comment.cpp Thu Aug 2 16:36:57 2012
@@ -194,6 +194,10 @@
} 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;
}
Modified: cfe/trunk/test/Sema/warn-documentation.cpp
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/warn-documentation.cpp?rev=161215&r1=161214&r2=161215&view=diff
==============================================================================
--- cfe/trunk/test/Sema/warn-documentation.cpp (original)
+++ cfe/trunk/test/Sema/warn-documentation.cpp Thu Aug 2 16:36:57 2012
@@ -250,6 +250,18 @@
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
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits