Add documentation comment to ForwardTemplateReference.

This node doesn't directly correspond to a mangled name fragment, so
it's useful to explicitly describe when it's created and what it's for.

llvm-svn: 340664
This commit is contained in:
Richard Smith 2018-08-24 22:33:53 +00:00
parent 2ae8468bd1
commit 55857c5bed
1 changed files with 18 additions and 0 deletions

View File

@ -1118,6 +1118,24 @@ public:
}
};
/// A forward-reference to a template argument that was not known at the point
/// where the template parameter name was parsed in a mangling.
///
/// This is created when demangling the name of a specialization of a
/// conversion function template:
///
/// \code
/// struct A {
/// template<typename T> operator T*();
/// };
/// \endcode
///
/// When demangling a specialization of the conversion function template, we
/// encounter the name of the template (including the \c T) before we reach
/// the template argument list, so we cannot substitute the parameter name
/// for the corresponding argument while parsing. Instead, we create a
/// \c ForwardTemplateReference node that is resolved after we parse the
/// template arguments.
struct ForwardTemplateReference : Node {
size_t Index;
Node *Ref = nullptr;