From: Douglas Gregor Date: Thu, 15 Mar 2012 19:32:20 +0000 (+0000) Subject: Document RedeclarableTemplateDecl::getInstantiatedFromMemberTemplate(). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0f5897bf5f919df28c76013d1efa17441f7241ff;p=clang Document RedeclarableTemplateDecl::getInstantiatedFromMemberTemplate(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152826 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/DeclTemplate.h b/include/clang/AST/DeclTemplate.h index 14a6ca685a..36549eab38 100644 --- a/include/clang/AST/DeclTemplate.h +++ b/include/clang/AST/DeclTemplate.h @@ -618,8 +618,42 @@ public: getCommonPtr()->InstantiatedFromMember.setInt(true); } - /// \brief Retrieve the previous declaration of this template, or - /// NULL if no such declaration exists. + /// \brief Retrieve the member template from which this template was + /// instantiated, or NULL if this template was not instantiated from a + /// member template. + /// + /// A template is instantiated from a member template when the member + /// template itself is part of a class template (or member thereof). For + /// example, given + /// + /// \code + /// template + /// struct X { + /// template void f(T, U); + /// }; + /// + /// void test(X x) { + /// x.f(1, 'a'); + /// }; + /// \endcode + /// + /// \c X::f is a FunctionTemplateDecl that describes the function + /// template + /// + /// \code + /// template void X::f(int, U); + /// \endcode + /// + /// which was itself created during the instantiation of \c X. Calling + /// getInstantiatedFromMemberTemplate() on this FunctionTemplateDecl will + /// retrieve the FunctionTemplateDecl for the original template "f" within + /// the class template \c X, i.e., + /// + /// \code + /// template + /// template + /// void X::f(T, U); + /// \endcode RedeclarableTemplateDecl *getInstantiatedFromMemberTemplate() { return getCommonPtr()->InstantiatedFromMember.getPointer(); }